2013-02-20 77 views
2

我的pom.xml的是罰款,我可以做一個乾淨的MVN安裝沒有問題,但是Eclipse描繪它的紅色和抱怨:如何讓eclipse不要在不更改pom.xml的情況下驗證pom.xml?

Description Resource Path Location Type 
Plugin execution not covered by lifecycle configuration: org.jacoco:jacoco-maven-plugin:0.5.10.201208310627:prepare-agent (execution: default, phase: initialize) pom.xml /super-project line 11 Maven Project Build Lifecycle Mapping Problem 

如何我只是告訴日食有關的pom.xml忘記,在換句話說,不要試圖編譯它,驗證它等等,所以我的項目沒有錯誤,並且它沒有塗成紅色?

回答

2

我有過類似的問題,在日食不喜歡在POM插件。我找到的解決方案是使用插件管理。從我自己的代碼的一個例子是:

<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.apache.maven.plugins 
           </groupId> 
           <artifactId> 
            maven-dependency-plugin 
           </artifactId> 
           <versionRange> 
            [2.6,) 
           </versionRange> 
           <goals> 
            <goal> 
             copy-dependencies 
            </goal> 
           </goals> 
          </pluginExecutionFilter> 
          <action> 
           <ignore /> 
          </action> 
         </pluginExecution> 
        </pluginExecutions> 
       </lifecycleMappingMetadata> 
      </configuration> 
     </plugin> 
    </plugins> 
</pluginManagement> 

它的混亂,但它也可以防止未來的開發者從具有相同頭痛。

official m2e page有辦法忽略他們,如果你正在運行4.2朱諾

+0

它得到了一些其他的方式,而不改變聚甲醛。就像我在我的問題中所說的,我不能修改POM來修復我的IDE。其他人正在使用其他IDE。 :( – JohnPristine 2013-02-20 16:03:51

+0

嘗試在這個網址的建議,然後http://wiki.eclipse.org/M2E_plugin_execution_not_covered如果你使用4.2它似乎你可以忽略本地生命週期。 – ctwomey1 2013-02-20 16:08:35

+0

這工作,謝謝! – JohnPristine 2013-02-20 16:22:42

相關問題