最近接手公司的一个maven项目的时候,遇到了下面的报错信息:
Plugin execution not covered by lifecycle configuration:org.apache.maven.plugins:maven-antrun-plugin:1.8:run (execution: compile, phase: compile)
废话不多说,直接说解决方案:
在报错的pom文件添加下面配置信息
<build>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse
m2e settings only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<versionRange>[1.0,)</versionRange>
<goals>
<goal>test-compile</goal>
<goal>compile</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
添加上面配置就可以解决报错!
当然还有其他的解决办法,比如在元数据的插件里面添加lifecycle-mapping-metadata.xml文件,lifecycle-mapping-metadata.xml文件可以在eclipse的安装目录的plugin里面找到,具体解决方案其他好多博客都有详细说明。