Am 2016-12-14 um 22:57 schrieb Robert Scholte:
Digging into this case before the change:

The 4 related modules ignoring the versions:

org.apache.maven.wagon:wagon:pom
{
    dependencyManagement {
     dependencies {
            org.apache.maven.wagon:wagon-provider-test:compile
        org.codehaus.plexus:plexus-container-default:test,
    }
    }
}

org.apache.maven.wagon:wagon-provider-test:jar {
    parent {
        org.apache.maven.wagon:wagon
    }

    dependencies {
       org.codehaus.plexus:plexus-container-default:compile,
    }
}

org.apache.maven.wagon:wagon-providers:pom {
    parent {
       org.apache.maven.wagon:wagon
    }
    dependencies {
        org.apache.maven.wagon:wagon-provider-test:test
    }
}

org.apache.maven.wagon:wagon-file:jar {
    parent {
       org.apache.maven.wagon:wagon-providers
    }
}

With the current M3.4.0-SNAPSHOT this fails during test-compile of
org.apache.maven.wagon:wagon-file because
org.codehaus.plexus:plexus-container-default is not on the classpath

btw. wagon-provider-test shows why I don't like managing elements which
have a default value: to me it looks weird to (re)set the scope to the
default value of compile. But that's a matter of taste, I know...

So why would we expect org.codehaus.plexus:plexus-container-default on
the test-classpath?
FileWagonTest is only using classes from wagon-provider-test, which is a
direct test-scoped dependency (via wagon-providers). Any compile/runtime
scoped dependencies from wagon-provider-test should be added to the
classpath: that's the responsibility of Maven, not of the user.

I've removed org.apache.maven.wagon:wagon-provider-test from
dependencyManagement and specify its version to the direct dependency
and still the build fails for the same reason.
To me this doesn't make sense, I think there's more to this.

Anyhow, the original resolution with the so-called bug matches much more
the expectations of dependency resolution and current behavior will
likely break quite some builds.
Replacing the scope of the dependency from test back its default compile
scope whereas the build fails due to missing this test-scoped dependency
is weird. I don't have a good story why this new behavior should be
better, so IMHO this change must be revisited. If that means we need to
adjust documentation, that's fine by me.

I just hit the same issue with the Maven Clean Plugin: plexus-container-default is missing on the classpath.

I think that Christian does the right thing, either adjusting code to documentation or the other way around. We just need to agree what is the right thing and change the problematic spot accordingly.

Don't having compile, runtime and test scoped transitive deps of a direct test dependency doesn't look right to me. There must be some reason why this decision was made eons ago.

At the end, I certainly agree with Robert.

Michael

On Wed, 14 Dec 2016 17:57:47 +0100, Robert Scholte
<rfscho...@apache.org> wrote:

Hi,

I read the comment but I'm not sure I follow. The original setup is a
widely used pattern: give dependencies which should always have the
test-scope this scope in the dependencyManagement of the parent.
Considering the case below it must be possible to give easymock the
test-scope (I cannot imagine it is used as compile/runtime dependency)

Robert

On Wed, 14 Dec 2016 00:44:56 +0100, <schu...@apache.org> wrote:

Repository: maven-wagon
Updated Branches:
  refs/heads/master 424971d40 -> f244ece2e


[MRESOLVER-9] DefaultDependencyCollector does not correctly handle
dependency management.

o Updated to stop managing the scope of transitive dependencies to
'test'. That scope
  is not transitive. The fix for MRESOLVER-9 updates the resolver to
correctly filter
  out transitive dependencies whose scope got managed to a
non-transitive scope. This
  makes the dependencies disappear from the classpath as of Maven
3.4. Another solution
  would have been to make the dependencies in question direct
dependencies. That way
  the scope could still be managed to 'test' without the dependencies
disappearing
  from the classpaths because they are no longer transitive.


Project: http://git-wip-us.apache.org/repos/asf/maven-wagon/repo
Commit:
http://git-wip-us.apache.org/repos/asf/maven-wagon/commit/f244ece2
Tree: http://git-wip-us.apache.org/repos/asf/maven-wagon/tree/f244ece2
Diff: http://git-wip-us.apache.org/repos/asf/maven-wagon/diff/f244ece2

Branch: refs/heads/master
Commit: f244ece2eee01500e4b1bc334b8dcd35b47f9422
Parents: 424971d
Author: Christian Schulte <schu...@apache.org>
Authored: Wed Dec 14 00:41:02 2016 +0100
Committer: Christian Schulte <schu...@apache.org>
Committed: Wed Dec 14 00:41:02 2016 +0100

----------------------------------------------------------------------
 pom.xml                           | 2 --
 wagon-tcks/wagon-tck-http/pom.xml | 1 -
 2 files changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/f244ece2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index fa18390..eefa01a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -282,7 +282,6 @@ under the License.
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-container-default</artifactId>
         <version>1.5.5</version>
-        <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
@@ -323,7 +322,6 @@ under the License.
         <groupId>org.easymock</groupId>
         <artifactId>easymock</artifactId>
         <version>3.2</version>
-        <scope>test</scope>
       </dependency>
      <dependency>

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/f244ece2/wagon-tcks/wagon-tck-http/pom.xml

----------------------------------------------------------------------
diff --git a/wagon-tcks/wagon-tck-http/pom.xml
b/wagon-tcks/wagon-tck-http/pom.xml
index 9653ab0..da280f9 100644
--- a/wagon-tcks/wagon-tck-http/pom.xml
+++ b/wagon-tcks/wagon-tck-http/pom.xml
@@ -35,7 +35,6 @@ under the License.
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-container-default</artifactId>
-      <!-- override test scope from parents -->
       <scope>compile</scope>
     </dependency>
     <dependency>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to