Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update to m2e 1.6 resulted in "Conflicting lifecycle mapping" error

After I've run an update in my Eclipse Luna SR2 (4.4.2) I got m2e 1.6.1.20150625-2338 installed. For a project where I use maven-war-plugin now I get the following errors in the problems view:

problems view

Full text:

Conflicting lifecycle mapping (plugin execution "org.apache.maven.plugins:maven-war-plugin:2.3:war (execution: war-standalone, phase: package)"). To enable full functionality, remove the conflicting mapping and run Maven->Update Project Configuration.

Conflicting lifecycle mapping (plugin execution "org.apache.maven.plugins:maven-war-plugin:2.3:war (execution: war-standalone, phase: package)"). To enable full functionality, remove the conflicting mapping and run Maven->Update Project Configuration.

The plugin configuration didn't cause a problem with the previous version of m2e. It looks ok in the pom, nothing unusual:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <executions>
        <execution>
            <id>war-standalone</id>
            <goals>
                <goal>war</goal>
            </goals>
            <phase>package</phase>
            <configuration>
                ...
            </configuration>
        </execution>
        <execution>
            <id>war-overlay</id>
            <goals>
                <goal>war</goal>
            </goals>
            <phase>package</phase>
            <configuration>
                ...
            </configuration>
        </execution>
    </executions>
</plugin>

The lifecycle-mapping for maven-war-plugin isn't configured in the pom. I checked if it is in parent poms but couldn't find anything. None is in the workspace lifecycle mappings metadata as well.

Then I noticed m2e-wtp plugin (where the mapping seems to come from) was still an old version. I updated it to 1.2.0.20150602-1740 but it didn't resolve the problem.

Any idea how to track down where is the conflicting mapping or maybe how to resolve the issue properly?

like image 511
Danny Lo Avatar asked Jun 30 '15 09:06

Danny Lo


2 Answers

The problem has been reported and a bug has been created for that.

Note that it has been fixed in m2e v1.6.2.

like image 62
Jan Krakora Avatar answered Oct 21 '22 00:10

Jan Krakora


I faced the same conflict problem when upgrading from m2e 1.6.0 to m2e 1.6.1, but on the maven-compiler-plugin configured for using the groovy-eclipse-compiler.

After investigation, I found this commit that might very well be at the origin of the error since it changes the way configurators are loaded and can result in loading more configurators. In my case, it seems like both default compiler configurator and groovy eclipse compiler configurator are loaded thus resulting in a conflict.

like image 40
Vincent Vandenschrick Avatar answered Oct 21 '22 00:10

Vincent Vandenschrick