JohnPristine
JohnPristine

Reputation: 3575

How to tell eclipse NOT to validate pom.xml without changing pom.xml?

My pom.xml is fine and I can do a mvn clean install without a problem but eclipse paints it red and complains about:

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

How do I just tell eclipse to forget about the pom.xml, in other words, not to try to compile it, validate it, etc. so my project does not have errors and it is not painted in red?

Upvotes: 2

Views: 5742

Answers (2)

ctwomey
ctwomey

Reputation: 479

I have had a similar problem in the past where eclipse doesn't like a plugin in the pom. The solution i've found is to use plugin management. An example from my own code is:

<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>

It's messy, but it also prevents future devs from having the same headaches.

official m2e page has a way to ignore them if you are running 4.2 Juno

Upvotes: 2

change
change

Reputation: 3558

This works well for me https://github.com/AdoptOpenJDK/javacountdown/issues/66. Eclipse issue!

Upvotes: 0

Related Questions