插件错误:生命周期配置未涵盖执行 [英] Plugin error: execution not covered by lifecycle configuration

查看:49
本文介绍了插件错误:生命周期配置未涵盖执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 maven-warpath-plugin 此处提供.但我的 pom.xml 文件中不断出现错误,内容为:

I am trying to use the maven-warpath-plugin available here. But I keep getting an error in my pom.xml file that says:

生命周期配置未涵盖的插件执行:org.appfuse.plugins:maven-warpath-plugin:2.1.0:add-classes (execution: default, phase: generate-sources)

Plugin execution not covered by lifecycle configuration: org.appfuse.plugins:maven-warpath-plugin:2.1.0:add-classes (execution: default, phase: generate-sources)

我该如何解决这个问题?这是我的插件 pom.xml 片段:

How do I resolve this? Here is my pom.xml snippet for the plugin:

<plugin>
    <groupId>org.appfuse.plugins</groupId>
    <artifactId>maven-warpath-plugin</artifactId>
    <version>2.1.0</version>
    <extensions>true</extensions>
    <executions>
        <execution>
            <goals>
                <goal>add-classes</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Eclipse 为我提供了一个 quickfox 提示来发现新的 m2e 连接器"来解决这个错误.我已经安装了大多数似乎适用的可用连接器,但错误仍然存​​在.有什么想法可以让我完成这项工作吗?

Eclipse offers me a quickfox tip to "discover new m2e connectors" to resolve this error. I have installed most of the connectors available that seem to apply but the error is still there. Any ideas how I could make this work?

推荐答案

这是新的行为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....

这篇关于插件错误:生命周期配置未涵盖执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆