zDev - M2E - OSS
  1. zDev - M2E - OSS
  2. MNGECLIPSE-679

Including Maven Dependencies as J2EE Module Dependencies results in error: "The project contains another dependency with the same archive name"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.4
    • Fix Version/s: 0.9.5
    • Component/s: WTP integration
    • Labels:
      None
    • Global Rank:
      13807

      Description

      Due to pom dependencies, we have some jars which have the same name and version but live in different groups. Looking in maven dependencies we can see these duplicates, but it does not cause normal build problems. However when we have maven dependencies checked in J2EE Module Dependencies we get Errors:
      The project contains another dependency with the same archive name

      Building with maven command line does not have this issue.

      Actual use case:

      The error we are getting is:

      Invalid classpath publish/export dependency C:/maven/repository/org/apache/geronimo/components/geronimo-transaction/2.0.1/geronimo-transaction-2.0.1.jar. The project contains another dependency with the same archive name.

      Invalid classpath publish/export dependency C:/maven/repository/org/apache/geronimo/modules/geronimo-connector/2.0.1/geronimo-connector-2.0.1.jar. The project contains another dependency with the same archive name.

      We have a pom.xml which includes the following dependencies:

      <dependency>
      <groupId>org.apache.geronimo.modules</groupId>
      <artifactId>geronimo-connector</artifactId>
      <version>2.0.1</version>
      </dependency>

      <dependency>
      <groupId>org.apache.geronimo.modules</groupId>
      <artifactId>geronimo-transaction</artifactId>
      <version>2.0.1</version>
      </dependency>

      If you check the dependencies of these modules, they include these dependencies respectively.

      <dependency>
      <groupId>org.apache.geronimo.components</groupId>
      <artifactId>geronimo-connector</artifactId>
      </dependency>

      <dependency>
      <groupId>org.apache.geronimo.components</groupId>
      <artifactId>geronimo-transaction</artifactId>
      </dependency>

      This means we have two distinct jars named geronimo-connector.jar and two distinct jars named geronimo-transaction.jar.

      Checked how maven command line handles this, and it seems that when preparing the WAR any jars that would name conflict are renamed with their full path. E.g: looking at jars built to WEB-INF/lib we see:
      ...
      log4j-1.2.14.jar
      org.apache.geronimo.components-geronimo-connector-2.0.1.jar
      org.apache.geronimo.components-geronimo-transaction-2.0.1.jar
      org.apache.geronimo.modules-geronimo-connector-2.0.1.jar
      org.apache.geronimo.modules-geronimo-transaction-2.0.1.jar
      persistence-api-1.0.jar
      ...

        Issue Links

          Activity

          Hide
          Eugene Kuleshov added a comment -

          Nathan, can you please attach test project or sample pom file that include those dependencies and configuration for Maven war plugin? Thanks.

          Show
          Eugene Kuleshov added a comment - Nathan, can you please attach test project or sample pom file that include those dependencies and configuration for Maven war plugin? Thanks.
          Hide
          nathan.mcdonald added a comment -

          Very Simple dynamic web project, configured to use java 6 and tomcat 6.

          Using eclipse 3.2.2 Build id: M20080221-1800

          Show
          nathan.mcdonald added a comment - Very Simple dynamic web project, configured to use java 6 and tomcat 6. Using eclipse 3.2.2 Build id: M20080221-1800
          Hide
          igorfie added a comment -

          The fix is to rename-and-copy artifacts that happen to have identical file name. Copies are created under <project>/target directory.

          Show
          igorfie added a comment - The fix is to rename-and-copy artifacts that happen to have identical file name. Copies are created under <project>/target directory.
          Hide
          igorfie added a comment -

          Forgot to mention, it would be really nice if the reporter could confirm if the fix actually works

          Show
          igorfie added a comment - Forgot to mention, it would be really nice if the reporter could confirm if the fix actually works

            People

            • Assignee:
              Igor Fedorenko
              Reporter:
              Deleted User
              Last Updated By:
              Fred Bricon
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: