我已阅读有关此主题的讨论,但没有看到简单的解决方案。
鉴于以下非常简单的 pom.xml、Indigo Eclipse 和 m2e(版本 0.14.0.201107060316),eclipse 抱怨
Multiple annotations found at this line
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources (execution: default-resources, phase: process-resources)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources (execution: default-testResources, phase: process-test-resources)
上
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.myproject</groupId>
<artifactId>myartifact</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>myartifact</name>
<url>http://maven.apache.org</url>
</project>
我知道这与添加一个部分有关,如http://wiki.eclipse.org/M2E_plugin_execution_not_covered#execute_plugin_goal中所示
我认为将以下部分添加到 pom.xml 中至少可以清除一个错误,但事实并非如此,所以我一定不能清楚地了解什么是错误的。
有什么建议吗?我相信这对你们中的一些人来说很简单。
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.myproject</groupId>
<artifactId>myartifact</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>myartifact</name>
<url>http://maven.apache.org</url>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<versionRange>2.4.3</versionRange>
<goals>
<goal>resources:resources</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute >
<runOnIncremental>false</runOnIncremental>
</execute >
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</project>