1. 程式人生 > >Plugin execution not covered by lifecycle configuration: 錯誤解決方案

Plugin execution not covered by lifecycle configuration: 錯誤解決方案

當一個新的maven專案匯入到新的工作空間中可能會遇到maven外掛lifecycle configuration 錯誤,這個錯誤可能是某個外掛衝突,這個我還沒沒有太明白太搞懂,如果有人知道具體是什麼原因引起的還請解釋一下。
這個錯誤我在官網上面找到解決方案如下:
在eclipse 中找到 window > preferences > Maven > Lifecycle Mappings
進入到change mapping file location 的目錄下 找到一個 lifecycle-mapping-metadata.xml 檔案如果沒有的話可以建立一個
然後加入一下這段程式碼
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
  <pluginExecutions>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <goals>
          <goal>create-timestamp</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>

    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <goals>
          <goal>list</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>

    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.zeroturnaround</groupId>
        <artifactId>jrebel-maven-plugin</artifactId>
        <goals>
          <goal>generate</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>

    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <goals>
          <goal>compile</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>

    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <goals>
          <goal>copy-dependencies</goal>
          <goal>unpack</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>

  </pluginExecutions>
</lifecycleMappingMetadata>
配置好後可以 maven -> update project 就可以看到錯誤已經沒有了。
官網地址 https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html#eclipse-workspace-lifecycle-mapping-metadata
 

轉載:https://blog.csdn.net/think_xyl/article/details/53495688