[jira] [Commented] (MDEP-610) Dependency order : Depending on transitive version instead of declared based on order of declaration
[ https://issues.apache.org/jira/browse/MDEP-610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16466876#comment-16466876 ] Jobin Jacob Kavalam commented on MDEP-610: -- [~michael-o] Following your suggestion adding "provided" scope fixes the problem. [https://github.com/ProcrastinatorCp/maven-dependency-issue-poc/commit/84ec915fd1e7feb6d79169466729f72edf6e272f] Why does this fix work though ? > Dependency order : Depending on transitive version instead of declared based > on order of declaration > > > Key: MDEP-610 > URL: https://issues.apache.org/jira/browse/MDEP-610 > Project: Maven Dependency Plugin > Issue Type: Bug > Environment: mvn -v > Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; > 2015-03-14T04:10:27+08:00) > Maven home: /home/cp/./apache-maven-3.3.1 > Java version: 1.8.0_121, vendor: Oracle Corporation > Java home: /home/cp/./oracle-jdk-1.8.0_121/jre > Default locale: en_SG, platform encoding: UTF-8 > OS name: "linux", version: "4.4.0-122-generic", arch: "amd64", family: "unix" >Reporter: Chandra Prakash >Priority: Minor > > h3. *Overview :* > The order of dependency declaration in the pom is taking precedence instead > of depth. Check this sample : > https://github.com/ProcrastinatorCp/maven-dependency-issue-poc > h3. *Example Scenario :* > There are two modules. *test-a* and *test-b* > *test-a* (depends on javax.servlet-api:2.5) > *test-b* (depends on test-a) > I want to use 3.1.0 version of above library in test-b. However, if test-a is > declared before ***javax.servlet-api*, executing *mvn clean package* fails. > {code:xml} > > > com.cp.test > test-a > ${com.cp.test.version} > > > javax.servlet > javax.servlet-api > 3.1.0 > > {code} > If I change the ordering, it works fine. > {code:xml} > > > javax.servlet > javax.servlet-api > 3.1.0[link title|http://example.com] > > > com.cp.test > test-a > ${com.cp.test.version} > > {code} > The documentation at : > [https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html] > > the current pom's declaration takes precedence over its parent's > declaration. > However, current pom declaration is not taking precedence *when ordered > differently* (as above pom) > Could you please confirm. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MDEP-610) Dependency order : Depending on transitive version instead of declared based on order of declaration
[ https://issues.apache.org/jira/browse/MDEP-610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16466814#comment-16466814 ] Chandra Prakash commented on MDEP-610: -- [~michael-o], Thanks for checking. My initial thinking was, "Cookie" is defined in both the artifacts and maven is picking from the transitive. So, I considered it as a bug. Anyway, now its clear. The build is success in scope for both the declarations. I will mark this issue as "Invalid" and get back if found something. > Dependency order : Depending on transitive version instead of declared based > on order of declaration > > > Key: MDEP-610 > URL: https://issues.apache.org/jira/browse/MDEP-610 > Project: Maven Dependency Plugin > Issue Type: Bug > Environment: mvn -v > Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; > 2015-03-14T04:10:27+08:00) > Maven home: /home/cp/./apache-maven-3.3.1 > Java version: 1.8.0_121, vendor: Oracle Corporation > Java home: /home/cp/./oracle-jdk-1.8.0_121/jre > Default locale: en_SG, platform encoding: UTF-8 > OS name: "linux", version: "4.4.0-122-generic", arch: "amd64", family: "unix" >Reporter: Chandra Prakash >Priority: Minor > > h3. *Overview :* > The order of dependency declaration in the pom is taking precedence instead > of depth. > h3. *Example Scenario :* > There are two modules. *test-a* and *test-b* > *test-a* (depends on javax.servlet-api:2.5) > *test-b* (depends on test-a) > I want to use 3.1.0 version of above library in test-b. However, if test-a is > declared before ***javax.servlet-api*, executing *mvn clean package* fails. > {code:xml} > > > com.cp.test > test-a > ${com.cp.test.version} > > > javax.servlet > javax.servlet-api > 3.1.0 > > {code} > If I change the ordering, it works fine. > {code:xml} > > > javax.servlet > javax.servlet-api > 3.1.0[link title|http://example.com] > > > com.cp.test > test-a > ${com.cp.test.version} > > {code} > The documentation at : > [https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html] > > the current pom's declaration takes precedence over its parent's > declaration. > However, current pom declaration is not taking precedence *when ordered > differently* (as above pom) > Could you please confirm. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MDEP-610) Dependency order : Depending on transitive version instead of declared based on order of declaration
[ https://issues.apache.org/jira/browse/MDEP-610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16466490#comment-16466490 ] Michael Osipov commented on MDEP-610: - Checked the project, thanks. There is no bug, the behavior is correct. Take a closer look at the artifact ids, they are different: {noformat} [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ my-app --- [INFO] com.mycompany.app:my-app:jar:1.0-SNAPSHOT [INFO] +- junit:junit:jar:3.8.1:test [INFO] +- com.mycompany.app:your-app:jar:1.0-SNAPSHOT:compile [INFO] | \- javax.servlet:servlet-api:jar:2.5:compile [INFO] \- javax.servlet:javax.servlet-api:jar:3.1.0:compile{noformat} >From a Maven perspective, they are different. Moreover, you *never* put the >Servlet API into compile scope. Always into provided. > Dependency order : Depending on transitive version instead of declared based > on order of declaration > > > Key: MDEP-610 > URL: https://issues.apache.org/jira/browse/MDEP-610 > Project: Maven Dependency Plugin > Issue Type: Bug > Environment: mvn -v > Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; > 2015-03-14T04:10:27+08:00) > Maven home: /home/cp/./apache-maven-3.3.1 > Java version: 1.8.0_121, vendor: Oracle Corporation > Java home: /home/cp/./oracle-jdk-1.8.0_121/jre > Default locale: en_SG, platform encoding: UTF-8 > OS name: "linux", version: "4.4.0-122-generic", arch: "amd64", family: "unix" >Reporter: Chandra Prakash >Priority: Minor > > h3. *Overview :* > The order of dependency declaration in the pom is taking precedence instead > of depth. > h3. *Example Scenario :* > There are two modules. *test-a* and *test-b* > *test-a* (depends on javax.servlet-api:2.5) > *test-b* (depends on test-a) > I want to use 3.1.0 version of above library in test-b. However, if test-a is > declared before ***javax.servlet-api*, executing *mvn clean package* fails. > {code:xml} > > > com.cp.test > test-a > ${com.cp.test.version} > > > javax.servlet > javax.servlet-api > 3.1.0 > > {code} > If I change the ordering, it works fine. > {code:xml} > > > javax.servlet > javax.servlet-api > 3.1.0[link title|http://example.com] > > > com.cp.test > test-a > ${com.cp.test.version} > > {code} > The documentation at : > [https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html] > > the current pom's declaration takes precedence over its parent's > declaration. > However, current pom declaration is not taking precedence *when ordered > differently* (as above pom) > Could you please confirm. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MDEP-610) Dependency order : Depending on transitive version instead of declared based on order of declaration
[ https://issues.apache.org/jira/browse/MDEP-610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16466181#comment-16466181 ] Chandra Prakash commented on MDEP-610: -- Hi [~michael-o], Could you please take a look at [https://github.com/ProcrastinatorCp/maven-dependency-issue-poc] PS : I have not verified with the recent version yet. Thanks. > Dependency order : Depending on transitive version instead of declared based > on order of declaration > > > Key: MDEP-610 > URL: https://issues.apache.org/jira/browse/MDEP-610 > Project: Maven Dependency Plugin > Issue Type: Bug > Environment: mvn -v > Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; > 2015-03-14T04:10:27+08:00) > Maven home: /home/cp/./apache-maven-3.3.1 > Java version: 1.8.0_121, vendor: Oracle Corporation > Java home: /home/cp/./oracle-jdk-1.8.0_121/jre > Default locale: en_SG, platform encoding: UTF-8 > OS name: "linux", version: "4.4.0-122-generic", arch: "amd64", family: "unix" >Reporter: Chandra Prakash >Priority: Minor > > h3. *Overview :* > The order of dependency declaration in the pom is taking precedence instead > of depth. > h3. *Example Scenario :* > There are two modules. *test-a* and *test-b* > *test-a* (depends on javax.servlet-api:2.5) > *test-b* (depends on test-a) > I want to use 3.1.0 version of above library in test-b. However, if test-a is > declared before ***javax.servlet-api*, executing *mvn clean package* fails. > {code:xml} > > > com.cp.test > test-a > ${com.cp.test.version} > > > javax.servlet > javax.servlet-api > 3.1.0 > > {code} > If I change the ordering, it works fine. > {code:xml} > > > javax.servlet > javax.servlet-api > 3.1.0[link title|http://example.com] > > > com.cp.test > test-a > ${com.cp.test.version} > > {code} > The documentation at : > [https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html] > > the current pom's declaration takes precedence over its parent's > declaration. > However, current pom declaration is not taking precedence *when ordered > differently* (as above pom) > Could you please confirm. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MDEP-610) Dependency order : Depending on transitive version instead of declared based on order of declaration
[ https://issues.apache.org/jira/browse/MDEP-610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16465886#comment-16465886 ] Michael Osipov commented on MDEP-610: - Please provide a sample project for this. > Dependency order : Depending on transitive version instead of declared based > on order of declaration > > > Key: MDEP-610 > URL: https://issues.apache.org/jira/browse/MDEP-610 > Project: Maven Dependency Plugin > Issue Type: Bug > Environment: mvn -v > Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; > 2015-03-14T04:10:27+08:00) > Maven home: /home/cp/./apache-maven-3.3.1 > Java version: 1.8.0_121, vendor: Oracle Corporation > Java home: /home/cp/./oracle-jdk-1.8.0_121/jre > Default locale: en_SG, platform encoding: UTF-8 > OS name: "linux", version: "4.4.0-122-generic", arch: "amd64", family: "unix" >Reporter: Chandra Prakash >Priority: Minor > > h3. *Overview :* > The order of dependency declaration in the pom is taking precedence instead > of depth. > h3. *Example Scenario :* > There are two modules. *test-a* and *test-b* > *test-a* (depends on javax.servlet-api:2.5) > *test-b* (depends on test-a) > I want to use 3.1.0 version of above library in test-b. However, if test-a is > declared before ***javax.servlet-api*, executing *mvn clean package* fails. > {code:xml} > > > com.cp.test > test-a > ${com.cp.test.version} > > > javax.servlet > javax.servlet-api > 3.1.0 > > {code} > If I change the ordering, it works fine. > {code:xml} > > > javax.servlet > javax.servlet-api > 3.1.0[link title|http://example.com] > > > com.cp.test > test-a > ${com.cp.test.version} > > {code} > The documentation at : > [https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html] > > the current pom's declaration takes precedence over its parent's > declaration. > However, current pom declaration is not taking precedence *when ordered > differently* (as above pom) > Could you please confirm. -- This message was sent by Atlassian JIRA (v7.6.3#76005)