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

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

Multiple annotations found at this line:
-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中添加一下代码即可:

<pluginManagement>
  <plugins>
    <plugin>
     <groupId>org.eclipse.m2e</groupId>
     <artifactId>lifecycle-mapping</artifactId>
     <version>1.0.0</version>
     <configuration>
       <lifecycleMappingMetadata>
         <pluginExecutions>
           <pluginExecution>
             <pluginExecutionFilter>
               <groupId>some-group-id</groupId>
               <artifactId>some-artifact-id</artifactId>
               <versionRange>[1.0.0,)</versionRange>
               <goals>
                 <goal>some-goal</goal>
               </goals>
             </pluginExecutionFilter>
             <action>
               <ignore/>
             </action>
           </pluginExecution>
         </pluginExecutions>
       </lifecycleMappingMetadata>
     </configuration>
    </plugin>
  </plugins>
</pluginManagement>

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

卸载MyEclipse,重装MyEclipse,

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

猜你喜欢

转载自blog.csdn.net/change_on/article/details/79508233
今日推荐