2011-12-05 67 views
1

我想將項目導入到Spring Source Tool Suite(最新版本)。設置Maven插件連接器錯誤

該項目以前由maven原型目錄創建。

我收到了屏幕截圖上顯示的錯誤。

我能夠導入相同的項目在不同的機器上,但具有相同的Maven存儲庫(我複製了整個.m2目錄)沒有任何問題。

注:所有這些樹捆:com.springsource.bundlor.maven1.0.0.RELEASE,國際化功能,Maven的插件,Maven的依賴,插件存在於.m2目錄/庫目錄

任何想法上如何解決它?

截圖與我下面的地址錯誤:

http://imageshack.us/photo/my-images/64/mavenpluginconnectors.png/

回答

1

你的錯誤無關,與項目或Maven配置。它與新版本的Eclipse現在內置M2E(以前稱爲M2Eclipse)項目有關。

新版本已得到改進,因此它在導入Maven項目時讀取了pom並正確設置了Eclipse項目。要做到這一點,它需要各種連接器,其中大部分已經可用並且配置爲正確的事情。然而,你的插件執行沒有預先配置好,所以你需要告訴M2E當Eclipse做Maven構建時你想要發生什麼。

對於我來說,我配置M2E通過添加以下內容BuildManagement 「忽略」 這些執行:

  <plugin> 
       <!--This plugin's configuration is used to store Eclipse m2e settings 
        only. It has no influence on the Maven build itself. --> 
       <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>[1.0,)</versionRange> 
            <goals> 
             <goal>copy-dependencies</goal> 
             <goal>unpack</goal> 
            </goals> 
           </pluginExecutionFilter> 
           <action> 
            <ignore /> 
           </action> 
          </pluginExecution> 
          <pluginExecution> 
           <pluginExecutionFilter> 
            <groupId>org.codehaus.mojo</groupId> 
            <artifactId>hibernate3-maven-plugin</artifactId> 
            <versionRange>[2.2,)</versionRange> 
            <goals> 
             <goal>hbm2ddl</goal> 
            </goals> 
           </pluginExecutionFilter> 
           <action> 
            <ignore></ignore> 
           </action> 
          </pluginExecution> 
          <pluginExecution> 
           <pluginExecutionFilter> 
            <groupId>org.sonatype.flexmojos</groupId> 
            <artifactId>flexmojos-maven-plugin</artifactId> 
            <versionRange>[4.0-RC2,)</versionRange> 
            <goals> 
             <goal>compile-swc</goal> 
             <goal>compile-swf</goal> 
             <goal>copy-flex-resources</goal> 
             <goal>generate</goal> 
             <goal>test-compile</goal> 
            </goals> 
           </pluginExecutionFilter> 
           <action> 
            <ignore /> 
           </action> 
          </pluginExecution> 
         </pluginExecutions> 
        </lifecycleMappingMetadata> 
       </configuration> 
      </plugin> 

閱讀所有關於它在這裏:

How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds

+0

謝謝,設法解決它。 –

0

我就遇到了這個問題以及。我發現問題在於我的項目需要的是Maven的舊​​版本,而不是使用Eclipse安裝的版本。

就我而言,eclipse隨安裝版本3.3.3一起發佈。我需要的版本3.0.5

我下載並安裝了我需要的maven的相應版本,並通過轉到:preferences> maven>安裝將其添加到eclipse中。

當您構建時,如果您通過eclipse構建,請確保選擇正確的maven版本。你應該有兩個從現在開始選擇。 Run as -> Maven Build... -> Maven Runtime: *select the proper version*

+0

將Maven安裝目錄更改爲舊版本並不適合我。我覺得這個答案可能會因您項目的具體目標而有很大差異。 – santafebound

+0

我不知道你如何確定你需要哪個maven版本,這是我的項目部落知識。當你執行mvn build命令時,請確保選擇正確的安裝。 – user1521567

+0

@ user1521567以及你是如何確定的? :) – Line