Maven-pom.xml文件报错 Plugin execution not covered by lifecycle configuration

问题:

  Eclipse中新导入的项目pom.xml文件报错:

    Plugin execution not covered by lifecycle configuration: org.jacoco:jacoco-maven-plugin:0.6.4.201312101107:prepare-agent (execution: pre-test, phase: process-classes

解决:

  步骤一:

    在eclipse中打开 Preferences --> Maven --> Lifecycle Mappings添加 ifecycle-mapping-metadata.xml

  

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
    <pluginExecutions>
        <pluginExecution>
            <pluginExecutionFilter>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <goals>
                    <goal>prepare-agent</goal>
                </goals>
                <versionRange>[0.5,)</versionRange>
            </pluginExecutionFilter>
            <action>
                <ignore />
            </action>
        </pluginExecution>
    </pluginExecutions>
</lifecycleMappingMetadata>

  然后点击 

  步骤二:

    Maven---> update Project

参考:

【1】csdn博客,http://blog.csdn.net/zbuger/article/details/51489422

原文地址:https://www.cnblogs.com/happyflyingpig/p/8568320.html