问题描述
为了使m2e 1.0正常工作,我不得不指定生命周期映射:
With intent to get m2e 1.0 working correctly I have had to specify the lifecycle mapping:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<versionRange>[2.0.2,)</versionRange>
<goals>
<goal>process</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
但是我收到这个警告:
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
如果我运行一些特定的maven任务,例如 mvn clean install findbugs:findbugs
(如果我只运行 mvn clean install
,那么没有这样的消息)
if I run some specific maven task for example mvn clean install findbugs:findbugs
(If I run only mvn clean install
then there is no such message)
我知道问题是这个POM不存在,因为它只被定义来保存映射信息。 ()
I know that the problem is that this POM does not exists, because it is only defined to hold the mapping information. (m2e lifecycle-mapping not found)
无论如何,我想保持我的构建清洁,没有任何警告,所以我如何摆脱这个具体的? (我的CI服务器检查是否没有警告。
Anyway, I want to keep my build clean, without any warnings, so how can I get rid of this specific one? (My CI server checks that there is no warning.)
我使用Maven 3.0.2,并尝试使用Maven 3.0.3,但是
I use Maven 3.0.2 and tried Maven 3.0.3 too, but the same result.
推荐答案
我的团队通过在配置文件中包含相关配置来解决此问题:
My team works around this problem by wrapping the relevant configuration in a profile:
<profile>
<id>only-eclipse</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
...
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
这篇关于摆脱POM未找到对org.eclipse.m2e的警告:生命周期映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!