[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.0.2:war (default-war) on project shop: A type incompatibility occured while executing org.apache.maven.plugins:maven-war-plugin:2.0.2:war: org.apache.maven.project.MavenProject cannot be cast to java.lang.String
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-war-plugin:2.0.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/D:/maven/mvnRespo/org/apache/maven/plugins/maven-war-plugin/2.0.2/maven-war-plugin-2.0.2.jar
[ERROR] urls[1] = file:/D:/maven/mvnRespo/org/apache/maven/maven-archiver/2.2/maven-archiver-2.2.jar
[ERROR] urls[2] = file:/D:/maven/mvnRespo/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[3] = file:/D:/maven/mvnRespo/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
[ERROR] urls[4] = file:/D:/maven/mvnRespo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[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/PluginExecutionException
pom 配置如下
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<webResources>
<resource>
<directory>src/main/webapp/WEB-INF</directory>
<filtering>true</filtering>
<targetPath>target</targetPath>
</resource>
</webResources>
</configuration>
</plugin>