Maven build\") works fin" />
开发者

Maven 2.2.1 fails to build EAR project with m2eclipse

开发者 https://www.devze.com 2023-02-18 08:53 出处:网络
I am having trouble building an EJB EAR with Maven in Eclipse 3.6 with the m2eclipse project builder. Curiously, a manual build (either on the command line or with \"Run as -> Maven build\") works fin

I am having trouble building an EJB EAR with Maven in Eclipse 3.6 with the m2eclipse project builder. Curiously, a manual build (either on the command line or with "Run as -> Maven build") works fine. I have set up Eclipse to use an external Maven 2.2.1 installation.

The error message is as follows:

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-ap开发者_C百科p: Failed to initialize ear modules

So apparently generation of the application.xml descriptor fails for some reason I could not yet determine.

In the error log view I have the following message:

Unknown artifact type[test-jar]

I have read in a forum that might be caused by a "test-jar" dependency that is missing "test" scope; however, I have double- and triple-checked for this and can't find any unscoped "test-jar" dependencies in my pom.xml files.

I've found the following entries with mvn help:effective-pom though:

  <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>

I have no idea where those dependencies come from or if they are relevant at all. The most curious thing is that, like I said, building works fine when I do it manually. However, this means that I can't use some m2eclipse features like WTP integration.

Any suggestions?


To find where dependencies come from, open your pom in m2eclipse's Maven POM editor. On the right hand side of the 'Dependency Hierarchy' tab, is the resolved dependency list. This is synonymous with the effective-pom dependency listing. Select any dependency on the right and where that dependencies comes from will be revealed on the left.

0

精彩评论

暂无评论...
验证码 换一张
取 消