When I try to run mvn clean install -U
or mvn jar:jar
it fails with:
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-jar-plugin:2.4
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/XXX/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar
[ERROR] urls[1] = file:/C:/Users/XXX/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[2] = file:/C:/Users/XXX/.m2/repository/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar
[ERROR] urls[3] = file:/C:/Users/XXX/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar
[ERROR] urls[4] = file:/C:/Users/XXX/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar
[ERROR] urls[5] = file:/C:/Users/XXX/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
[ERROR] urls[6] = file:/C:/Users/XXX/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[7] = file:/C:/Users/XXX/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.15/plexus-interpolation-1.15.jar
[ERROR] urls[8] = file:/C:/Users/XXX/.m2/repository/org/codehaus/plexus/plexus-archiver/2.1/plexus-archiver-2.1.jar
[ERROR] urls[9] = file:/C:/Users/XXX/.m2/repository/org/codehaus/plexus/plexus-io/2.0.2/plexus-io-2.0.2.jar
[ERROR] urls[10] = file:/C:/Users/XXX/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
[ERROR] urls[11] = file:/C:/Users/XXX/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
The projet is built fine with: mvn compiler:compile
.
All jar files exist.
I don't understand how is it possible to fail when it just create a simple jar file...
Thanks for any idea.
I finally find the answer, prepare yourself:
rd /Q /S C:\Users\XXX\.m2\repository
mvn clean install -U
mvn package
It works without any issue... Still don't understand why the jar was corrupted as it was previously downloaded by maven...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.