0

我是 m2e 和 Maven 方面的菜鸟。我现在想在 eclipse 中构建一个 Maven 项目,所以我安装了一个 M2E 插件。但是,每当我构建一个新的 Maven 项目时,最初的全新项目在pom文件。我检查了它,它总是发生在包装线上,我从来没有在构建新项目时自定义它,所以我应该是战争,但错误说
"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)-<packaging>war</packaging>"

您能否提供一些有关如何解决此问题的提示?谢谢。

我尝试从不同类型的原型构建,但错误是相同的。

4

1 回答 1

2

See: http://wiki.eclipse.org/M2E_plugin_execution_not_covered

To solve some long-standing issues, m2e 1.0 requires explicit instructions what to do with all Maven plugins bound to "interesting" phases (see M2E interesting lifecycle phases) of project build lifecycle. We call these instructions "project build lifecycle mapping" or simply "lifecycle mapping" because they define how m2e maps information from project pom.xml file to Eclipse workspace project configuration and behaviour during Eclipse workspace build.

Project build lifecycle mapping configuration can be specified in project pom.xml, contributed by Eclipse plugins and there is also default configuration for some commonly used Maven plugins shipped with m2e. We call these "lifecycle mapping metadata sources". m2e will create error marker like below for all plugin executions that do not have lifecycle mapping in any of the mapping metadata sources.

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:1.3:run (execution: generate-sources-input, phase: generate-sources) m2e matches plugin executions to actions using combination of plugin groupId, artifactId, version range and goal. There are three basic actions that m2e can be instructed to do with a plugin execution -- ignore, execute and delegate to a project configurator.

<build>
<pluginManagement>
    <plugins>
        <!-- Ignore/Execute plugin execution -->
        <!-- this is to eliminate eclipse import errors -->
        <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
                <lifecycleMappingMetadata>
                    <pluginExecutions>
                    <!-- copy-dependency plugin -->
                        <pluginExecution>
                            <pluginExecutionFilter>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-resources-plugin</artifactId>
                                <versionRange>[2.4.3,)</versionRange>
                                <goals>
                                    <goal>resources</goal>
                                    <goal>testResources</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <ignore />
                            </action>
                        </pluginExecution>
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
         </plugin>
    </plugins>
</pluginManagement>

You can see more info here: http://deepaksrivastav.com/?p=155

于 2013-03-05T12:14:31.093 回答