解决Maven出现Plugin execution not covered by lifecycle configuration 错误
2017-02-03 14:42
936 查看
报错如下: Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution: default-testCompile, phase: test-compile)究其原因是因为基于maven的项目多使用各种maven plugin来完成开发中的一些工作,例如编译代码,打包,部署等,每个plugin包含许多的goal,用来做特定的事情。例如 clean compile test package deploy等。除了这些比较常见的goal之外,项目中还可以使用大量的第三方的plugin,甚至自己动手开发的plugin。随之而来的问题是,在eclipse中编辑maven项目的时候,eclipse并不知道这些特殊用途的goal要做什么。所以m2eclipse这个集成maven到eclipse的plugin就提供了开发extra的能力,eclipse利用这些extra来完成本来在mavenplugin要干的活。如果eclipse没有办法知道某个goal要干什么,那么就会看到这个错误信息。解决办法之一:在StackOverFlow中一个帖子说在pom.xml中在报错的plugin的外面再包上一层<pluginManagement></pluginManagement> 如下:
<build> <pluginManagement> <plugins> <plugin> ... </plugin> <plugin> ... </plugin> .... </plugins> </pluginManagement> </build>解决办法二: pluginManagement的作用是作为公用的插件配置项,给子项目共用的。如果这个项目没有子项目,这样做就不合理了或者有时候父项目pom不能被修改,也就没办法添加pluginManagement。这时候就可以采用第二种方案:在Eclipse中Window->Perferences->Maven->Lifecycle Mapping选项卡中点击Open workspace lifecycle mappings metadata,在打卡的xml中添加如下内容并保存:
<?xml version="1.0" encoding="UTF-8"?><lifecycleMappingMetadata><pluginExecutions><pluginExecution><pluginExecutionFilter><groupId>org.codehaus.mojo</groupId><artifactId>sql-maven-plugin</artifactId><goals><goal>execute</goal></goals><versionRange>[1.4,)</versionRange></pluginExecutionFilter><action><ignore /></action></pluginExecution></pluginExecutions></lifecycleMappingMetadata>将groupId和artifactId及versionRange根据具体的插件进行修改,保存之后记得点击 ”Reload workspace lifecycle mappings metadata“按钮
相关文章推荐
- 解决Maven出现Plugin execution not covered by lifecycle configuration 错误
- 解决 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”
- 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案
- 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案
- eclipse使用maven在pom配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案
- 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案
- 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案
- 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案
- Maven项目POM文件错误,提示“Plugin execution not covered by lifecycle configuration”的解决方案
- 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案
- 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案
- 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案
- maven的Plugin execution not covered by lifecycle configuration解决办法
- 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案
- 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案
- 备忘:maven 错误信息: Plugin execution not covered by lifecycle configuration
- Maven经典错误之二- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-mave
- 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案
- 备忘:maven 错误信息: Plugin execution not covered by lifecycle configuration
- 在POM配置Maven plugin提示错误“Plugin execution not covered by lifecycle configuration”的解决方案