今天在工作中遇到一个很郁闷的问题,用myeclipse的maven插件mvn install的时候老是失败,报错如下:
[INFO] ------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------
[INFO] Total time: 1.134s
[INFO] Finished at: Wed Mar 14 15:39:12 CST 2012
[INFO] Final Memory: 3M/6M
[INFO] ------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1-alpha-1:war (default-war) on project aipisoft_search_web: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.1-alpha-1:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.1-alpha-1'. A required class is missing: org/codehaus/plexus/archiver/jar/JarArchiver
后来发现是maven指定版本问题,在pom.xml中添加如下内容解决问题:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
</configuration>
</plugin>