更新到m2e1.6会导致“冲突的生命周期映射”错误

时间:2022-01-10 10:39:29

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:

在Eclipse Luna SR2(4.4.2)中运行了更新之后,我安装了m2e 1.6.1.20150625-2338。对于一个使用maven-war-plugin的项目,我在problems视图中有以下错误:

更新到m2e1.6会导致“冲突的生命周期映射”错误

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.

冲突的生命周期映射(插件执行“org.apache. mavenins .plugins:maven-war-plugin:2.3:war(执行:war - independent, phase: package)”)。要启用完整的功能,请删除冲突映射并运行Maven->更新项目配置。

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.

冲突的生命周期映射(插件执行“org.apache. mavenins .plugins:maven-war-plugin:2.3:war(执行:war - independent, phase: package)”)。要启用完整的功能,请删除冲突映射并运行Maven->更新项目配置。

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

插件配置对之前版本的m2e没有问题。在pom上看起来不错,没什么特别的:

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

maven-war-plugin的生命周期映射没有在pom中配置。我检查了它是否在父poms上,但什么也没找到。工作区生命周期映射元数据中也没有。

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.

然后我注意到m2e-wtp插件(映射的来源)仍然是一个旧版本。我把它更新到1.2.0.20150602-1740,但是没有解决问题。

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

您知道如何跟踪冲突映射在哪里,或者如何正确地解决问题吗?

2 个解决方案

#1


5  

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

已经报告了这个问题,并为此创建了一个bug。

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

注意,它已经在m2e v1.6.2中修复。

#2


1  

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.

我在从m2e1.6.0升级到m2e1.6.1时遇到了同样的冲突问题,但是在配置为使用groovy-eclipse编译器的maven-compiler-plugin上。

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.

经过调查,我发现这个提交很可能是错误的根源,因为它改变了配置程序的加载方式,并可能导致加载更多配置程序。在我的例子中,似乎默认的编译器配置程序和groovy eclipse编译器配置程序都被加载,从而导致了冲突。

#1


5  

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

已经报告了这个问题,并为此创建了一个bug。

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

注意,它已经在m2e v1.6.2中修复。

#2


1  

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.

我在从m2e1.6.0升级到m2e1.6.1时遇到了同样的冲突问题,但是在配置为使用groovy-eclipse编译器的maven-compiler-plugin上。

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.

经过调查,我发现这个提交很可能是错误的根源,因为它改变了配置程序的加载方式,并可能导致加载更多配置程序。在我的例子中,似乎默认的编译器配置程序和groovy eclipse编译器配置程序都被加载,从而导致了冲突。