Multiple annotations found at this line: -Plugin execution not covered by lifecycle configuration: o

布满荆棘的人生 2022-05-30 10:35 282阅读 0赞

Myeclipse新建项目的pom.xml文件报错:

  1. Multiple annotations found at this line:
  2. -Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:2.6:run (execution: define-classpath, phase: process-resources)

查了好多资料,最终找到用pluginManagement解决,详见官方文档:https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html

在 /build中添加一下代码即可:

  1. <pluginManagement>
  2. <plugins>
  3. <plugin>
  4. <groupId>org.eclipse.m2e</groupId>
  5. <artifactId>lifecycle-mapping</artifactId>
  6. <version>1.0.0</version>
  7. <configuration>
  8. <lifecycleMappingMetadata>
  9. <pluginExecutions>
  10. <pluginExecution>
  11. <pluginExecutionFilter>
  12. <groupId>some-group-id</groupId>
  13. <artifactId>some-artifact-id</artifactId>
  14. <versionRange>[1.0.0,)</versionRange>
  15. <goals>
  16. <goal>some-goal</goal>
  17. </goals>
  18. </pluginExecutionFilter>
  19. <action>
  20. <ignore/>
  21. </action>
  22. </pluginExecution>
  23. </pluginExecutions>
  24. </lifecycleMappingMetadata>
  25. </configuration>
  26. </plugin>
  27. </plugins>
  28. </pluginManagement>

是,我不喜欢在每个pom.xml添加代码,我希望越来简洁越好,尝试了很多个方法,最终,用了最简单粗暴的方法解决了问题:

卸载MyEclipse,重装MyEclipse,

然后新建项目,pom就不会再报错! 还是一样的简洁!!

发表评论

表情:
评论列表 (有 0 条评论,282人围观)

还没有评论,来说两句吧...

相关阅读