解决Maven报Plugin execution not covered by lifecycle configuration (转载)
生活随笔
收集整理的這篇文章主要介紹了
解决Maven报Plugin execution not covered by lifecycle configuration (转载)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
原文地址:http://blog.csdn.net/xxd851116/article/details/25197373
出現場景
以前的老項目,在我的環境(我的環境較新)下,別人老環境不報錯。錯誤示例
一個錯誤示例,子項目引用了父項目,子項目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://stackoverflow.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://www.cnblogs.com/huanglin101/p/7977972.html
總結
以上是生活随笔為你收集整理的解决Maven报Plugin execution not covered by lifecycle configuration (转载)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [转]关于形如--error LNK20
- 下一篇: 【学习笔记】树形结构基础