2011-03-21 87 views
4

我在使用m2eclipse項目構建器的Eclipse 3.6中使用Maven構建EJB EAR時遇到問題。奇怪的是,手動構建(無論是在命令行或「運行 - > Maven構建」)工作正常。我已經將Eclipse設置爲使用外部Maven 2.2.1安裝。Maven 2.2.1無法使用m2eclipse構建EAR項目

錯誤消息如下:

Build errors for my-app; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:2.4.2:generate-application-xml (default-generate-application-xml) on project my-app: Failed to initialize ear modules 

因此很明顯,代application.xml描述符中由於某種原因,我還不能確定失敗。

在我有以下消息的錯誤日誌視圖:

Unknown artifact type[test-jar] 

我已經在這可能是由「測試罐子」的依賴是缺少「測試」範圍引起的論壇閱讀;然而,我對此進行了雙重檢查和三重檢查,並且在我的pom.xml文件中找不到任何無與倫比的「test-jar」依賴項。

我發現與MVN幫助以下項目:有效-POM雖然:

<dependency> 
    <groupId>org.jboss.test</groupId> 
    <artifactId>jboss-test</artifactId> 
    <version>1.1.4.GA</version> 
    <exclusions> 
     <exclusion> 
     <artifactId>log4j</artifactId> 
     <groupId>apache-log4j</groupId> 
     </exclusion> 
    </exclusions> 
    </dependency> 

    <!-- ... ---> 

    <dependency> 
    <groupId>jboss.jms-integration-tests</groupId> 
    <artifactId>integration-mdb20</artifactId> 
    <version>1.0.1.GA</version> 
    </dependency> 
    <dependency> 
    <groupId>jboss.jms-integration-tests</groupId> 
    <artifactId>integration-mdb20-durable</artifactId> 
    <version>1.0.1.GA</version> 
    </dependency> 
    <dependency> 
    <groupId>jboss.jms-integration-tests</groupId> 
    <artifactId>integration-mdb20-selector</artifactId> 
    <version>1.0.1.GA</version> 
    </dependency> 
    <dependency> 
    <groupId>jboss.jms-integration-tests</groupId> 
    <artifactId>integration-mdb20-userTransaction</artifactId> 
    <version>1.0.1.GA</version> 
    </dependency> 
    <dependency> 
    <groupId>jboss.jms-integration-tests</groupId> 
    <artifactId>integration-mdb20-userTransactionDups</artifactId> 
    <version>1.0.1.GA</version> 
    </dependency> 
    <dependency> 
    <groupId>jboss.jms-integration-tests</groupId> 
    <artifactId>jms-integration-tests</artifactId> 
    <version>1.0.1.GA</version> 
    </dependency> 

我不知道在哪裏那些依賴來自或者如果他們在相關的一切。 最奇怪的是,就像我說的那樣,當我手動完成時,建築工作正常。 但是,這意味着我不能使用像WTP集成這樣的一些m2eclipse功能。

有什麼建議嗎?

回答

1

要找到依賴來自何處,請在m2eclipse的Maven POM編輯器中打開您的pom。在「依賴關係層次」選項卡的右側,是已解析的依賴關係列表。這與effective-pom依賴列表同義。在右側選擇任何依賴關係,並在左側顯示依賴關係來自哪裏。

HTH

+0

謝謝,試過了,但這些依賴甚至不依賴關係樹出現 - 無論是在Eclipse或與MVN依賴在命令行:樹。 – chris 2011-03-21 21:37:34