Maven:Plugin execution not covered by lifecycle
程序员文章站
2022-03-05 11:29:11
...
解决Maven报Plugin execution not covered by lifecycle
参考:https://my.oschina.net/u/1380885/blog/424830
出现场景
以前的老项目,在我的环境(我的环境较新)下,别人老环境不报错。
错误示例
一个错误示例,子项目引用了父项目,子项目parent标签处报错如下:
Multiple annotations found at this line:
- maven-enforcer-plugin (goal "enforce") is ignored by m2e.
- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.3.1:compile (execution:
default, phase: compile)
解决办法
官网给出解释及解决办法:http://wiki.eclipse.org/M2E_plugin_execution_not_covered
这里有人说下面这样也可以解决, 即 <plugins> 标签外再套一个 <pluginManagement> 标签,我试验是成功的:
http://*.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin
<build>
<pluginManagement>
<plugins>
<plugin> ... </plugin>
<plugin> ... </plugin>
....
</plugins>
</pluginManagement>
</build>
但是有时候父项目pom不能被修改,可用官网最后给出的解决办法:
Window-Perferences-Maven-Lifecycle Mapping
保存如下内容:
<?xml version= "1.0" encoding= "UTF-8"?>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<goals>
<goal>compile</goal>
</goals>
<versionRange>[ 1. 3,)</versionRange>
</pluginExecutionFilter>
< action>
<ignore />
</ action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
记得点击 ”Reload workspace lifecycle mappings metadata“按钮
问题解决。
参考:https://my.oschina.net/u/1380885/blog/424830
出现场景
以前的老项目,在我的环境(我的环境较新)下,别人老环境不报错。
错误示例
一个错误示例,子项目引用了父项目,子项目parent标签处报错如下:
Multiple annotations found at this line:
- maven-enforcer-plugin (goal "enforce") is ignored by m2e.
- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.3.1:compile (execution:
default, phase: compile)
解决办法
官网给出解释及解决办法:http://wiki.eclipse.org/M2E_plugin_execution_not_covered
这里有人说下面这样也可以解决, 即 <plugins> 标签外再套一个 <pluginManagement> 标签,我试验是成功的:
http://*.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin
<build>
<pluginManagement>
<plugins>
<plugin> ... </plugin>
<plugin> ... </plugin>
....
</plugins>
</pluginManagement>
</build>
但是有时候父项目pom不能被修改,可用官网最后给出的解决办法:
Window-Perferences-Maven-Lifecycle Mapping
保存如下内容:
<?xml version= "1.0" encoding= "UTF-8"?>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<goals>
<goal>compile</goal>
</goals>
<versionRange>[ 1. 3,)</versionRange>
</pluginExecutionFilter>
< action>
<ignore />
</ action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
记得点击 ”Reload workspace lifecycle mappings metadata“按钮
问题解决。
上一篇: 模糊分类项目
下一篇: java占位符像C#{0}那样简单
推荐阅读
-
maven项目-修复Plugin execution not covered by lifecycle configuration: org.codehaus.
-
Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.8:add-test-source (execution: add-functional-so
-
没有找到Plugin execution not covered by lifecycle
-
Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.8:add-test-source (execution: add-functional-so
-
maven项目-修复Plugin execution not covered by lifecycle configuration: org.codehaus.
-
pom文件报Plugin execution not covered by lifecycle configuration。
-
Maven:Plugin execution not covered by lifecycle