在IDEA上,用maven打包的时候,报错:
[INFO]
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ spark ---
[WARNING] The POM for org.codehaus.plexus:plexus-utils:jar:3.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.430s
[INFO] Finished at: Sun Oct 09 11:12:30 CST 2016
[INFO] Final Memory: 12M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar (default-jar) on project spark: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar failed: A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar: org/codehaus/plexus/util/IOUtil
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-jar-plugin:2.3.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/Administrator/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/2.3.2/maven-jar-plugin-2.3.2.jar
[ERROR] urls[1] = file:/C:/Users/Administrator/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[2] = file:/C:/Users/Administrator/.m2/repository/org/apache/maven/maven-archiver/2.4.2/maven-archiver-2.4.2.jar
[ERROR] urls[3] = file:/C:/Users/Administrator/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar
[ERROR] urls[4] = file:/C:/Users/Administrator/.m2/repository/org/codehaus/plexus/plexus-archiver/2.0.1/plexus-archiver-2.0.1.jar
[ERROR] urls[5] = file:/C:/Users/Administrator/.m2/repository/org/codehaus/plexus/plexus-io/2.0.1/plexus-io-2.0.1.jar
[ERROR] urls[6] = file:/C:/Users/Administrator/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
[ERROR] urls[7] = file:/C:/Users/Administrator/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.util.IOUtil
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
Process finished with exit code 1
奇怪的是,pom文件是我之前工程的,并没有任何改动,而且其他工程是可以打包成功的。
点http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException 进去看了一眼,大概说是版本不符。
行吧,死马当活马医吧
我在pom上加了
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.6</version> </plugin>再次打包,竟然正常了!!!
具体这个原因还是不清楚!