解决Eclipse 导入项目 Plugin execution not covered by lifecycle configuration: org.apache.maven

Eclipse 导入项目 Pom.xml出现如下错误:Multiple annotations found at this line:
    - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.3:testCompile (execution:
     default-testCompile, phase: test-compile)
    - maven-enforcer-plugin (goal "enforce") is ignored by m2e.
    - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (execution: default-
     compile, phase: compile)

参照:https://www.cnblogs.com/heimafeng/p/6413237.html的方法
eclipse的安装目录下的plugins下的org.eclipse.m2e.lifecyclemapping.defaults_xxxxxx.jar文件中找到lifecycle-mapping-metadata.xml文件将其拷贝到
Q:/eclipse-workspace/nexus/.metadata/.plugins/org.eclipse.m2e.core/

在其中加入

 <pluginExecution>
            <pluginExecutionFilter>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <goals>
                    <goal>testCompile</goal>
                </goals>
                <versionRange>[3.3,)</versionRange>
            </pluginExecutionFilter>
            <action>
                <ignore />
            </action>
        </pluginExecution>

        <pluginExecution>
            <pluginExecutionFilter>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <goals>
                    <goal>compile</goal>
                </goals>
                <versionRange>[3.3,)</versionRange>
            </pluginExecutionFilter>
            <action>
                <ignore />
            </action>
        </pluginExecution>

解决了上述两个错误

在父pom.xml中加入

                        <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-enforcer-plugin</artifactId>
                                    <versionRange>[1.0.0,)</versionRange>
                                    <goals>
                                        <goal>enforce</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore />
                                </action>
                            </pluginExecution>

解决了

- maven-enforcer-plugin (goal "enforce") is ignored by m2e.


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值