[jira] [Commented] (MNG-6058) Test dependencies should override application dependencies only during testing
[ https://issues.apache.org/jira/browse/MNG-6058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17815574#comment-17815574 ] Tamas Cservenak commented on MNG-6058: -- This is a long outstanding bug (present since 3.0.0) explained here MNG-8041 Resolver does not work like this, as explained here [https://maven.apache.org/resolver-archives/resolver-2.0.0-alpha-7/common-misconceptions.html#misconception-no2-%E2%80%9Ctest-graph%E2%80%9D-is-superset-of-%E2%80%9Cruntime-graph%E2%80%9D] Unsure will this be fixed for 3.x as that line worked like this from start. Most probably to be fixed in 4.x > Test dependencies should override application dependencies only during testing > -- > > Key: MNG-6058 > URL: https://issues.apache.org/jira/browse/MNG-6058 > Project: Maven > Issue Type: Bug >Reporter: Christian Schulte >Priority: Critical > Attachments: MNG-6058.zip > > > The following graph > {code} > POM > |->a 2.0 compile > |-->b 2.0 compile > |->b 1.0 test > {code} > will be mediated to > {code} > POM > |->a 2.0 compile > |->b 1.0 test > {code} > The test dependency on b will make the transitive application dependency on b > disappear. Maven should understand that the application dependency on b in > version 2.0 is part of the application classpath and that the test > dependency on b in version 1.0 is part of the test classpath only (overriding > the application classpath). If someone adds a dependency on a project like > that, the test dependency will disappear because the test scope is not > transitive so that a "consuming" project gets a different application > classpath than the project itself. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-6058) Test dependencies should override application dependencies only during testing
[ https://issues.apache.org/jira/browse/MNG-6058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17506372#comment-17506372 ] Joe Barnett commented on MNG-6058: -- see also https://issues.apache.org/jira/browse/MNG-4156 and [https://github.com/HubSpot/dependency-scope-maven-plugin] ? If this is fixed in maven 3.x would the dependency-scope-maven-plugin essentially no longer be needed? > Test dependencies should override application dependencies only during testing > -- > > Key: MNG-6058 > URL: https://issues.apache.org/jira/browse/MNG-6058 > Project: Maven > Issue Type: Bug >Reporter: Christian Schulte >Priority: Critical > Attachments: MNG-6058.zip > > > The following graph > {code} > POM > |->a 2.0 compile > |-->b 2.0 compile > |->b 1.0 test > {code} > will be mediated to > {code} > POM > |->a 2.0 compile > |->b 1.0 test > {code} > The test dependency on b will make the transitive application dependency on b > disappear. Maven should understand that the application dependency on b in > version 2.0 is part of the application classpath and that the test > dependency on b in version 1.0 is part of the test classpath only (overriding > the application classpath). If someone adds a dependency on a project like > that, the test dependency will disappear because the test scope is not > transitive so that a "consuming" project gets a different application > classpath than the project itself. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (MNG-6058) Test dependencies should override application dependencies only during testing
[ https://issues.apache.org/jira/browse/MNG-6058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17498137#comment-17498137 ] Elliotte Rusty Harold commented on MNG-6058: I think we should fix this here ASAP. I can't imagine someone depending on this behavior in 3.x. Working around it, yes, but not depending on it. No, I do not think we should make a change in maven-dependency-plugin to bless this. maven-dependency-plugin is **correctly** identifying this bug in Maven itself. > Test dependencies should override application dependencies only during testing > -- > > Key: MNG-6058 > URL: https://issues.apache.org/jira/browse/MNG-6058 > Project: Maven > Issue Type: Bug >Reporter: Christian Schulte >Priority: Critical > Attachments: MNG-6058.zip > > > The following graph > {code} > POM > |->a 2.0 compile > |-->b 2.0 compile > |->b 1.0 test > {code} > will be mediated to > {code} > POM > |->a 2.0 compile > |->b 1.0 test > {code} > The test dependency on b will make the transitive application dependency on b > disappear. Maven should understand that the application dependency on b in > version 2.0 is part of the application classpath and that the test > dependency on b in version 1.0 is part of the test classpath only (overriding > the application classpath). If someone adds a dependency on a project like > that, the test dependency will disappear because the test scope is not > transitive so that a "consuming" project gets a different application > classpath than the project itself. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (MNG-6058) Test dependencies should override application dependencies only during testing
[ https://issues.apache.org/jira/browse/MNG-6058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17497807#comment-17497807 ] Thorsten Glaser commented on MNG-6058: -- You don’t see me disagreeing there. However: * that should probably be done in Maven 4 as it’s a backwards-incompatible change * independent of where it’s done, we *really* _need_ a fixed current version of {{maven-dependency-plugin}} now, for compatibility with contemporary versions of the JDK * newer versions of the {{maven-dependency-plugin}} can and will be run on current-and-older versions of Maven for a *long* time, so independent of when and where the change is introduced, {{maven-dependency-plugin}} *must* stay aware of Maven versions not having this change being in productive use and work well with them > Test dependencies should override application dependencies only during testing > -- > > Key: MNG-6058 > URL: https://issues.apache.org/jira/browse/MNG-6058 > Project: Maven > Issue Type: Bug >Reporter: Christian Schulte >Priority: Critical > Attachments: MNG-6058.zip > > > The following graph > {code} > POM > |->a 2.0 compile > |-->b 2.0 compile > |->b 1.0 test > {code} > will be mediated to > {code} > POM > |->a 2.0 compile > |->b 1.0 test > {code} > The test dependency on b will make the transitive application dependency on b > disappear. Maven should understand that the application dependency on b in > version 2.0 is part of the application classpath and that the test > dependency on b in version 1.0 is part of the test classpath only (overriding > the application classpath). If someone adds a dependency on a project like > that, the test dependency will disappear because the test scope is not > transitive so that a "consuming" project gets a different application > classpath than the project itself. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (MNG-6058) Test dependencies should override application dependencies only during testing
[ https://issues.apache.org/jira/browse/MNG-6058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17497730#comment-17497730 ] Elliotte Rusty Harold commented on MNG-6058: The table on https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html suggests this is working as intended. If so, I think the intention should be revisited. test scope should not override compile scope like this. > Test dependencies should override application dependencies only during testing > -- > > Key: MNG-6058 > URL: https://issues.apache.org/jira/browse/MNG-6058 > Project: Maven > Issue Type: Bug >Reporter: Christian Schulte >Priority: Critical > Attachments: MNG-6058.zip > > > The following graph > {code} > POM > |->a 2.0 compile > |-->b 2.0 compile > |->b 1.0 test > {code} > will be mediated to > {code} > POM > |->a 2.0 compile > |->b 1.0 test > {code} > The test dependency on b will make the transitive application dependency on b > disappear. Maven should understand that the application dependency on b in > version 2.0 is part of the application classpath and that the test > dependency on b in version 1.0 is part of the test classpath only (overriding > the application classpath). If someone adds a dependency on a project like > that, the test dependency will disappear because the test scope is not > transitive so that a "consuming" project gets a different application > classpath than the project itself. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (MNG-6058) Test dependencies should override application dependencies only during testing
[ https://issues.apache.org/jira/browse/MNG-6058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17497728#comment-17497728 ] Elliotte Rusty Harold commented on MNG-6058: There are two things going on here that might be independent questions: 1. Which version of b should Maven add to the compile time classpath? 2. Which scope should it have? One could perhaps make a case that 1.0 is the correct version to select, but there's no world I can imagine in which dropping the dependency from the compile time classpath makes any sense at all. > Test dependencies should override application dependencies only during testing > -- > > Key: MNG-6058 > URL: https://issues.apache.org/jira/browse/MNG-6058 > Project: Maven > Issue Type: Bug >Reporter: Christian Schulte >Priority: Critical > Attachments: MNG-6058.zip > > > The following graph > {code} > POM > |->a 2.0 compile > |-->b 2.0 compile > |->b 1.0 test > {code} > will be mediated to > {code} > POM > |->a 2.0 compile > |->b 1.0 test > {code} > The test dependency on b will make the transitive application dependency on b > disappear. Maven should understand that the application dependency on b in > version 2.0 is part of the application classpath and that the test > dependency on b in version 1.0 is part of the test classpath only (overriding > the application classpath). If someone adds a dependency on a project like > that, the test dependency will disappear because the test scope is not > transitive so that a "consuming" project gets a different application > classpath than the project itself. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (MNG-6058) Test dependencies should override application dependencies only during testing
[ https://issues.apache.org/jira/browse/MNG-6058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17495231#comment-17495231 ] Thorsten Glaser commented on MNG-6058: -- Referenced in https://issues.apache.org/jira/browse/MDEP-791 But if so, we’re going to have a way to override a dependency multiple times, for different scopes. > Test dependencies should override application dependencies only during testing > -- > > Key: MNG-6058 > URL: https://issues.apache.org/jira/browse/MNG-6058 > Project: Maven > Issue Type: Bug >Reporter: Christian Schulte >Priority: Major > Attachments: MNG-6058.zip > > > The following graph > {code} > POM > |->a 2.0 compile > |-->b 2.0 compile > |->b 1.0 test > {code} > will be mediated to > {code} > POM > |->a 2.0 compile > |->b 1.0 test > {code} > The test dependency on b will make the transitive application dependency on b > disappear. Maven should understand that the application dependency on b in > version 2.0 is part of the application classpath and that the test > dependency on b in version 1.0 is part of the test classpath only (overriding > the application classpath). If someone adds a dependency on a project like > that, the test dependency will disappear because the test scope is not > transitive so that a "consuming" project gets a different application > classpath than the project itself. -- This message was sent by Atlassian Jira (v8.20.1#820001)