且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

插件错误:生命周期配置未涵盖执行

更新时间:2023-08-22 13:58:22

这是新的行为m2e(取代了旧的 m2eclipse 插件).要指定 eclipse 应该对插件做什么,您必须在项目的 pom.xml 中配置构建生命周期映射 - 或者安装一个连接器(它决定插件是否需要在 eclipse 构建中执行)(如果它存在).

This is the new behaviour of m2e (which replaced the old m2eclipse plugin). To specify what eclipse should do with the plugin you have to configure the build lifecycle mapping in the project's pom.xml - or install a connector (which decides if the plugin needs to be executed in an eclipse build or not) if it exists.

由于 maven-warpath-plugin 似乎没有连接器,但您必须在 pom.xml 中定义行为.您可以为此使用第二个 eclipse 快速修复程序(将 pom.xml 中的目标添加类永久标记为在 eclipse 构建中被忽略).这会将以下部分添加到您的 pom:

As there seems to be no connector for the maven-warpath-plugin yet you have to define the behaviour in the pom. You can use the second eclipse quickfix for this (Permamnently mark goal add-classes in pom.xml as ignored in eclipse build). This will add the following section to your pom:

<build>
    ......
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings 
                only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.appfuse.plugins
                                    </groupId>
                                    <artifactId>
                                        maven-warpath-plugin
                                    </artifactId>
                                    <versionRange>
                                        [2.1.0,)
                                    </versionRange>
                                    <goals>
                                        <goal>add-classes</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

如果您想在每个 Eclipse 构建中处理插件(在 importcode>, clean, ...).

You can change the <ignore> action to <execute> if you want to process the plugin in each eclipse build (on import, clean, ...).

插件配置是特定于 Eclipse 的并且不会使 pom.xml 看起来更好 - 但至少它对 Maven 构建没有影响....

The plugin configuration is eclipse specific and does not make the pom.xml look nicer - but at least it has no influence on the Maven build....