This errors could happen executing the release:perform goal in Maven:

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven-deploy-plugin:2.2.1
[INFO] check that the following section of the pom.xml is present and correct:
[INFO]
[INFO] <distributionManagement>
[INFO]  <!-- use the following if you're not using a snapshot version. -->
[INFO]  <repository>
[INFO]    <id>repo</id>
[INFO]    <name>Repository Name</name>
[INFO]    <url>scp://host/path/to/repo</url>
[INFO]  </repository>
[INFO]  <!-- use the following if you ARE using a snapshot version. -->
[INFO]  <snapshotRepository>
[INFO]    <id>repo</id>
[INFO]    <name>Repository Name</name>
[INFO]    <url>scp://host/path/to/repo</url>
[INFO]  </snapshotRepository>
[INFO] </distributionManagement>
[INFO] Cause: Class 'org.apache.maven.artifact.repository.ArtifactRepository' cannot be instantiated
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch

The funny thing is that I already had the listed section <distributionManagement> in the .pom file.

To fix it, try redoing the release:prepare specifying to the mvn command line “-Dresume=false” as in following:

$ mvn release:prepare -Dresume=false

In my case, the release:prepare was failing at the first time (because I was missing unit tests) and from then on the relese:perform was unsuccesful giving that misleading error. That’s one of the (many) Maven bugs.


One Response to “Maven: Class ‘org.apache.maven.artifact.repository.ArtifactRepository’ cannot be instantiated”  

  1. 1 Tim | The Way Things Work

    In my case, the I’m doing this through Hudson/Jenkins but when I specify the “release version” to do a “tag”, it still gets the branch number and increments that. Annoying!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



Calendar

June 2008
M T W T F S S
« May   Jul »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Follow me

twitter flickr LinkedIn feed

Subscribe by email

Enter your email address:

Archives


Categories

Tag Cloud


Listening