Chariot Training Classes

Training Courses

I run Chariot's training and mentoring services. We provide training in AngularJS, HTML5, Spring, Hibernate, Maven, Scala, and more.

Chariot Education Services

Technology

Chariot Emerging Tech

Learn about upcoming technologies and trends from my colleagues at Chariot Solutions.

Resources

Chariot Conferences

Podcasts

« Webflow + Roo Again - a More Complex Example... | Main | Spring Roo and Web Flow, the Expergated Version... »
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

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>