解决Maven报Plugin execution not covered by lifecycle configuration

当公司项目,pom.xml报错

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor (execution: default-descriptor, phase: generate-resources) 

pom.xml代码段如下

<plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.2</version>
        <configuration>
          <goalPrefix>gboat2.doc.generator</goalPrefix>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
</plugins>

解决方案:

  1. 在Eclipse的工作空间中找到这个文件(没有则新建):workSpace(你的工作空间)\.metadata\.plugins\org.eclipse.m2e.core\lifecycle-mapping-metadata.xml;
  2. 文件内容如下,但<groupId>、<artifactId>、<versionRange>、<goal>要与pom.xml中报错部分一致;

    <?xml version="1.0" encoding="UTF-8"?>
    <lifecycleMappingMetadata>
      <pluginExecutions>
        <pluginExecution>
          <pluginExecutionFilter>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-plugin-plugin</artifactId>
            <versionRange>[3.2,)</versionRange>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </pluginExecutionFilter>
          <action>
            <ignore/>
          </action>
        </pluginExecution>
      </pluginExecutions>
    </lifecycleMappingMetadata>
    
  3. 文件保存后需在eclipse中做如下操作:Windows → Preferences →  Maven →  Lifecycle mappings点击Reload workspace lifecycle mappings metadata按钮;

  4.  

    如果报错仍然没有消失,则在报错项目上右键Maven→Update Project即可;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值