问题描述
我正在尝试使用maven-warpath-plugin 。但是我的pom.xml文件中出现错误:
我解决了这个问题这是我的插件的pom.xml片段:
< plugin>
< groupId> org.appfuse.plugins< / groupId>
< artifactId> maven-warpath-plugin< / artifactId>
< version> 2.1.0< / version>
< extensions> true< / extensions>
<执行>
< execution>
< goals>
< goal> add-classes< / goal>
< / goals>
< / execution>
< / executions>
< / plugin>
Eclipse为我提供了一个quickfox提示,以发现新的m2e连接器来解决这个错误。我已经安装了大部分可用的连接器,似乎适用,但错误仍然存在。任何想法如何使这项工作?
这是新的的m2e(替换了旧的m2eclipse插件)。要指定eclipse应该如何使用插件,您必须在项目的pom.xml中配置构建生命周期映射 - 或安装连接器(它决定是否需要在eclipse构建中执行插件)(如果存在) / p>
由于maven-warpath-plugin似乎没有连接器,您必须定义pom中的行为。您可以使用第二个eclipse quickfix(在eclipse build 中忽略pom.xml中的目标添加类别)。这将添加以下部分到您的pom:
< build>
......
< pluginManagement>
< plugins>
<! - 此插件的配置用于仅存储Eclipse m2e设置
。它对Maven构建本身没有影响。 - >
< plugin>
< groupId> org.eclipse.m2e< / groupId>
< artifactId>生命周期映射< / 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>
您可以更改< ignore>
如果要在每个eclipse构建中处理插件( import
,<$ c),请执行< execute>
$ c> clean ,...)。
插件配置是eclipse特定的,不会使pom.xml看起来更好 - 但是至少它对Maven构建没有影响。
I am trying to use the maven-warpath-plugin available here. But I keep getting an error in my pom.xml file that says:
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 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?
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.
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>
You can change the <ignore>
action to <execute>
if you want to process the plugin in each eclipse build (on import
, clean
, ...).
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....
这篇关于插件错误:执行未覆盖生命周期配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!