Technology

I'm speaking at...

I teach and consult for

Practical, smart application development, mentoring, training.

Spring, Hibernate, Grails, Rails and Maven training from the experts!
Training Calendar

Roo in Action

Soon in print!

Spring Roo in Action
MEAP Available Now!

Author, Roo in Action - in MEAP now
Manning Book Forum
My Roo Blog Entries
Srini Penchikala InfoQ

Twittery!

@krimple
@techcast
@gdickens
@RooInAction

I host the
Chariot TechCast

Entries in codehaus (1)

Wednesday
Sep222010

My Maven doesn't build Codehaus anymore, what's wrong?

Recently Codehaus moved artifacts to the nexus repository system, and added a 302 MOVED directive to every request to the OLD repository. (See HAUS-1991).

But, Maven can't deal with this (I haven't tested this assumption in Maven 3.0.0, but it certainly fails in 2.x)

So, if you have:

  • a) Maven
  • b) a Codehaus plugin or artifact

and you try to build, you MAY get this error:

[INFO] Error building POM (may not be this project's POM).

Project ID: org.codehaus.mojo:jboss-packaging-maven-plugin

Reason: Error getting POM for 'org.codehaus.mojo:jboss-packaging-maven-plugin' from the repository: Unable to read local copy of metadata: Cannot read metadata from '/Users/krimple/.m2/repository/org/codehaus/mojo/jboss-packaging-maven-plugin/maven-metadata-codehaus.xml': end tag name  must match start tag name 
from line 7 (position: TEXT seen ...\n... @9:8) org.codehaus.mojo:jboss-packaging-maven-plugin:pom:LATEST

So, how do you fix it?

Semi-easy. First, replace any reference to the codehaus repos with these, as documented in the link to HAUS-1991 above:

  • Deploy snapshot artifacts into repository https://nexus.codehaus.org/content/repositories/snapshots
  • Deploy release artifacts into the staging repository https://nexus.codehaus.org/service/local/staging/deploy/maven2
  • Promote staged artifacts into repository 'Releases'
  • Download snapshot and release artifacts from group https://nexus.codehaus.org/content/groups/public
  • Download snapshot, release and staged artifacts from staging group https://nexus.codehaus.org/content/groups/staging

Then you will have to delete the files that maven complains about in the .m2 directory - they'll be ones like org/codehaus/mojo/jboss-packaging-maven-plugin/maven-metadata-codehaus.xml - that contain the errant HTML document that sends a redirect header.

Do a mvn package again and you'll be set.

HTH, Ken