java – Maven 2.2. 1 unable to build ear project using m2eclipse

I encountered a problem when using M2 eclipse project builder to build EJB ear with Maven in eclipse 3.6 Strangely, manual builds (on the command line or "run as – > Maven builds") work properly I have set up eclipse to use 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-app: Failed to initialize ear modules

Obviously, application The generation of XML descriptor failed for some reason I can't determine

In the error log view, I have the following message:

UnkNown artifact type[test-jar]

I read in a forum that the lack of "test" scope may be caused by "test tank" dependence; However, I double and triple checked this, and in my POM No uncompiled 'test jar' dependencies were found in the XML file

I found the following entry in MVN help: effective POM although:

<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 don't know where these dependencies come from or whether they are related The strangest thing is, as I said, when I finish it manually, the building works normally However, this means that I can't use m2eclipse features like WTP integration

Any suggestions?

Solution

To find the source of the dependency, open your pom.com in the Maven POM editor in m2eclipse On the right side of the dependency hierarchy tab is a list of resolved dependencies This is synonymous with a valid POM dependency list Select any dependency on the right and the source of the dependency will be displayed on the left

HTH

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>