[
https://jira.codehaus.org/browse/MNG-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=359446#comment-359446
]
Stéphane Nicoll commented on MNG-5739:
--------------------------------------
Seriously? A user is reporting an issue, the least we can do is look at the
description:
{quote}
My understanding is that this is because the shortest route to the root of the
hierarchy wins and, for a number of the Jetty dependencies, the shortest route
is via the test-scoped org.apache.solr:sole-core. I can understand a
test-scoped dependency being upgraded to the compile scope when a dependency is
added, but downgrading a dependency from the compile scope to the test scope
feels broken to me.
{quote}
I think there's more than a fair amount of analysis on Andy's end which is
great. If you skip the dependency output (which is less of 50% of the
description by the way), you can see that Andy suggests a workaround that makes
it clear that there's a dependency resolution problem:
{quote}
I can work around the problem by using dependency management to force the
dependencies into the compile scope, or by declaring direct dependencies on the
transitive dependencies of org.eclipse.jetty:jetty-webapp
{quote}
That put aside, this looks like broken to me as well. Thoughts?
> Adding a test dependency can move dependencies from the compile scope to the
> test scope
> ---------------------------------------------------------------------------------------
>
> Key: MNG-5739
> URL: https://jira.codehaus.org/browse/MNG-5739
> Project: Maven
> Issue Type: Bug
> Components: Dependencies
> Reporter: Andy Wilkinson
> Attachments: pom.xml, test-scope-problem.zip
>
>
> I'm seeing some strange behaviour where the transitive dependencies of a
> test-scope dependency are causing transitive dependencies of a compile-scope
> dependency to become test-scoped.
> A pom with a single dependency on {{org.eclipse.jetty:jetty-webapp}} produces
> the following dependencies:
> {noformat}
> $ mvn dependency:tree | grep org.eclipse.jetty:
> [INFO] \- org.eclipse.jetty:jetty-webapp:jar:8.1.10.v20130312:compile
> [INFO] +- org.eclipse.jetty:jetty-xml:jar:8.1.10.v20130312:compile
> [INFO] | \- org.eclipse.jetty:jetty-util:jar:8.1.10.v20130312:compile
> [INFO] \- org.eclipse.jetty:jetty-servlet:jar:8.1.10.v20130312:compile
> [INFO] \- org.eclipse.jetty:jetty-security:jar:8.1.10.v20130312:compile
> [INFO] \- org.eclipse.jetty:jetty-server:jar:8.1.10.v20130312:compile
> [INFO] +-
> org.eclipse.jetty:jetty-continuation:jar:8.1.10.v20130312:compile
> [INFO] \-
> org.eclipse.jetty:jetty-http:jar:8.1.10.v20130312:compile
> [INFO] \-
> org.eclipse.jetty:jetty-io:jar:8.1.10.v20130312:compile
> {noformat}
> If I now add a test dependency on {{org.apache.solr:sole-core}}, a number of
> dependencies that were previously in the compile scope are now in the test
> scope:
> {noformat}
> $ mvn dependency:tree | grep org.eclipse.jetty:
> [INFO] +- org.eclipse.jetty:jetty-webapp:jar:8.1.10.v20130312:compile
> [INFO] | +- org.eclipse.jetty:jetty-xml:jar:8.1.10.v20130312:compile
> [INFO] | \- org.eclipse.jetty:jetty-servlet:jar:8.1.10.v20130312:compile
> [INFO] +- org.eclipse.jetty:jetty-continuation:jar:8.1.10.v20130312:test
> [INFO] +- org.eclipse.jetty:jetty-deploy:jar:8.1.10.v20130312:test
> [INFO] +- org.eclipse.jetty:jetty-http:jar:8.1.10.v20130312:test
> [INFO] +- org.eclipse.jetty:jetty-io:jar:8.1.10.v20130312:test
> [INFO] +- org.eclipse.jetty:jetty-jmx:jar:8.1.10.v20130312:test
> [INFO] +- org.eclipse.jetty:jetty-security:jar:8.1.10.v20130312:compile
> [INFO] +- org.eclipse.jetty:jetty-server:jar:8.1.10.v20130312:test
> [INFO] +- org.eclipse.jetty:jetty-util:jar:8.1.10.v20130312:compile
> {noformat}
> My understanding is that this is because the shortest route to the root of
> the hierarchy wins and, for a number of the Jetty dependencies, the shortest
> route is via the test-scoped {{org.apache.solr:sole-core}}. I can understand
> a test-scoped dependency being upgraded to the compile scope when a
> dependency is added, but downgrading a dependency from the compile scope to
> the test scope feels broken to me.
> I can work around the problem by using dependency management to force the
> dependencies into the compile scope, or by declaring direct dependencies on
> the transitive dependencies of {{org.eclipse.jetty:jetty-webapp}}, but both
> approaches require me to know what all those dependencies are and "duplicate"
> them in my pom, undermining the value of the dependencies being pulled in
> transitively in the first place.
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)