1

我已阅读有关此主题的讨论,但没有看到简单的解决方案。

鉴于以下非常简单的 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>
4

1 回答 1

1

我面临同样的问题(Eclipse Indigo,Maven 3.0.2)。我按照此处指示的步骤解决了它: http ://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven

我安装了以下功能(使用 eclipse->Help->Install New Software): - Eclipse 的 Maven 集成 - WTP 的 Maven 集成:http: //download.jboss.org/jbosstools/updates/m2eclipse-wtp

安装这些功能后,我会更新项目(右键单击项目->Maven->更新项目..)。这对我有用。我希望这会有所帮助。

于 2012-08-26T11:10:38.923 回答