Java Maven 2.2.1无法使用m2eclipse构建EAR项目
我在使用m2eclipse项目生成器在Eclipse3.6中使用Maven构建EJBEAR时遇到问题。奇怪的是,手动构建(在命令行上或使用“runas->Maven build”)可以很好地工作。我已经将Eclipse设置为使用外部Maven 2.2.1安装 错误消息如下所示:Java Maven 2.2.1无法使用m2eclipse构建EAR项目,java,eclipse,maven,m2eclipse,ear,Java,Eclipse,Maven,M2eclipse,Ear,我在使用m2eclipse项目生成器在Eclipse3.6中使用Maven构建EJBEAR时遇到问题。奇怪的是,手动构建(在命令行上或使用“runas->Maven build”)可以很好地工作。我已经将Eclipse设置为使用外部Maven 2.2.1安装 错误消息如下所示: Build errors for my-app; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.ap
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]
我在一个论坛上读到,这可能是由缺少“测试”范围的“测试jar”依赖项引起的;但是,我对此进行了双重和三重检查,在pom.xml文件中找不到任何未定义范围的“testjar”依赖项
我在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>
org.jboss.test
jboss测试
1.1.4.GA
log4j
apache-log4j
jboss.jms-integration-tests
集成-mdb20
1.0.1.GA
jboss.jms-integration-tests
集成-mdb20-持久
1.0.1.GA
jboss.jms-integration-tests
集成-mdb20-选择器
1.0.1.GA
jboss.jms-integration-tests
integration-mdb20-userTransaction
1.0.1.GA
jboss.jms-integration-tests
integration-mdb20-userTransactionDups
1.0.1.GA
jboss.jms-integration-tests
jms集成测试
1.0.1.GA
我不知道这些依赖关系来自何处,也不知道它们是否相关。
最奇怪的是,正如我所说的,当我手动创建时,它工作得很好。
然而,这意味着我不能使用一些m2eclipse特性,比如WTP集成
有什么建议吗?要找到依赖项的来源,请在m2eclipse的Maven pom编辑器中打开pom。在“依赖关系层次结构”选项卡的右侧,是已解析的依赖关系列表。这是有效pom依赖项列表的同义词。选择右侧的任何依赖项,该依赖项的来源将显示在左侧
HTH谢谢,我试过了,但是这些依赖关系甚至没有显示在依赖关系树中——无论是在Eclipse中还是在命令行中,都没有显示在mvn dependency:tree中。