Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5057

The order in which you declare dependencies in pom.xml affect resulting WAR file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Not A Problem
    • 3.0.3
    • None
    • Dependencies
    • None

    Description

      When I declare my pom as follows (see attached war-with-xml-apis.zip) then the jar file xml-apis-1.0.b2 is in my WAR file:

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <groupId>ripe</groupId>
          <artifactId>web</artifactId>
          <packaging>war</packaging>
          <version>0.0.1-SNAPSHOT</version>
          <name>web Maven Webapp</name>
          <url>http://maven.apache.org</url>
          <dependencies>
              <dependency>
                  <groupId>com.atomikos</groupId>
                  <artifactId>transactions-jta</artifactId>
                  <version>3.6.4</version>
                  <scope>test</scope>
              </dependency>
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-entitymanager</artifactId>
                  <version>3.4.0.GA</version>
                  <scope>test</scope>
              </dependency>
              <dependency>
                  <groupId>org.axonframework</groupId>
                  <artifactId>axon-core</artifactId>
                  <version>0.7.1</version>
                  <exclusions>
                      <exclusion>
                          <groupId>xml-apis</groupId>
                          <artifactId>xml-apis</artifactId>
                      </exclusion>
                  </exclusions>
              </dependency>
          </dependencies>
          <build>
              <finalName>web</finalName>
          </build>
      </project>
      

      However, when I declare my pom as follows (axon-core is moved one up) then the xml-apis.jar is no longer in my WAR.

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <groupId>ripe</groupId>
          <artifactId>web</artifactId>
          <packaging>war</packaging>
          <version>0.0.1-SNAPSHOT</version>
          <name>web Maven Webapp</name>
          <url>http://maven.apache.org</url>
          <dependencies>
              <dependency>
                  <groupId>com.atomikos</groupId>
                  <artifactId>transactions-jta</artifactId>
                  <version>3.6.4</version>
                  <scope>test</scope>
              </dependency>
              <dependency>
                  <groupId>org.axonframework</groupId>
                  <artifactId>axon-core</artifactId>
                  <version>0.7.1</version>
                  <exclusions>
                      <exclusion>
                          <groupId>xml-apis</groupId>
                          <artifactId>xml-apis</artifactId>
                      </exclusion>
                  </exclusions>
              </dependency>
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-entitymanager</artifactId>
                  <version>3.4.0.GA</version>
                  <scope>test</scope>
              </dependency>
          </dependencies>
          <build>
              <finalName>web</finalName>
          </build>
      </project>
      

      Attachments

        Issue Links

          Activity

            People

              bentmann Benjamin Bentmann
              lvonk Lars Vonk
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: