Java 如何告诉eclipse在不更改pom.xml的情况下不验证pom.xml?
我的pom.xml很好,我可以毫无问题地进行mvn干净安装,但eclipse将其涂成红色并抱怨:Java 如何告诉eclipse在不更改pom.xml的情况下不验证pom.xml?,java,eclipse,maven,m2eclipse,jacoco,Java,Eclipse,Maven,M2eclipse,Jacoco,我的pom.xml很好,我可以毫无问题地进行mvn干净安装,但eclipse将其涂成红色并抱怨: Description Resource Path Location Type Plugin execution not covered by lifecycle configuration: org.jacoco:jacoco-maven-plugin:0.5.10.201208310627:prepare-agent (execution: default, phase: in
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: org.jacoco:jacoco-maven-plugin:0.5.10.201208310627:prepare-agent (execution: default, phase: initialize) pom.xml /super-project line 11 Maven Project Build Lifecycle Mapping Problem
我如何告诉eclipse忘记pom.xml,换句话说,不要尝试编译、验证它,等等。这样我的项目就不会有错误,也不会被涂成红色?我过去也遇到过类似的问题,eclipse不喜欢pom中的插件。我找到的解决方案是使用插件管理。我自己的代码中有一个例子:
<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.apache.maven.plugins
</groupId>
<artifactId>
maven-dependency-plugin
</artifactId>
<versionRange>
[2.6,)
</versionRange>
<goals>
<goal>
copy-dependencies
</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
org.eclipse.m2e
如果您运行的是4.2 Juno,有一种方法可以忽略它们。这对我来说很好。
月食问题 这一定是另一种不改变POM的方式。正如我在问题中所说,我不能仅仅为了修复IDE而更改POM。其他人正在使用其他IDE:(请尝试此url中的建议,如果您使用的是4.2,那么您可以在本地忽略生命周期。