You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sc...@apache.org on 2016/12/13 23:44:56 UTC

maven-wagon git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management.

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 <sc...@apache.org>
Authored: Wed Dec 14 00:41:02 2016 +0100
Committer: Christian Schulte <sc...@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>


Re: maven-wagon git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management.

Posted by Christian Schulte <cs...@schulte.it>.
Am 12/15/16 um 01:15 schrieb Christian Schulte:
> Am 12/14/16 um 23:29 schrieb Michael Osipov:
>> 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.
> 
> That could be another bug.
> 
> A -> B (test) -> C (compile)
> 
> When we say "Test scope is not transitive", C should not be resolved as
> well. That's just another inconsistency. We have B in test scope and so
> all transitive dependencies of B implicitly will become test scope. That
> scope is not transitive, so C and all other transitive dependencies of B
> should not be resolved. It's really still inconsistent.

By this I mean: If the scope of C is not managed to 'test', it currently
will be resolved. It really shouldn't, following the 'Test scope is not
transitive'. I read that as: The test scope does not support transitive
dependencies.


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


Re: maven-wagon git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management.

Posted by Christian Schulte <cs...@schulte.it>.
Am 12/14/16 um 23:29 schrieb Michael Osipov:
> 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.

That could be another bug.

A -> B (test) -> C (compile)

When we say "Test scope is not transitive", C should not be resolved as
well. That's just another inconsistency. We have B in test scope and so
all transitive dependencies of B implicitly will become test scope. That
scope is not transitive, so C and all other transitive dependencies of B
should not be resolved. It's really still inconsistent.

> At the end, I certainly agree with Robert.

If we make "test" scope really consistently non-transitive, we'll soon
all agree that this makes no sense, IMHO.

Regards,
-- 
Christian


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


Re: maven-wagon git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management.

Posted by Michael Osipov <mi...@apache.org>.
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
> <rf...@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, <sc...@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 <sc...@apache.org>
>>> Authored: Wed Dec 14 00:41:02 2016 +0100
>>> Committer: Christian Schulte <sc...@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-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


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


Re: maven-wagon git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management.

Posted by Christian Schulte <cs...@schulte.it>.
Just an additional information. Maven core and the resolver are not
behaving consistently in that area and also not in the "repository
overriding" area. As you may have noticed, I am just heading for
consistency. I am having a hard time figuring out why the core has not
been updated to reflect changes in the resolver and vice versa. That's
what I did. I have never expected this to lead to such discussions.
Maybe it's just time to reach a consensus on the things in question.
There is no consensus between the core and the resolver in some areas.
Maybe in a lot more areas no-one noticed yet.


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


Re: maven-wagon git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management.

Posted by Michael Osipov <mi...@apache.org>.
Am 2016-12-15 um 00:39 schrieb Christian Schulte:
> Am 12/15/16 um 00:19 schrieb Christian Schulte:
>>  -ldm,--legacy-dependency-management
>> Use Maven 2 dependency management behaviour. Can also be activated by
>> using -Dmaven.legacyDependencyManagement=true.
>>
>> There are a bunch of issues in JIRA affecting dependency management.
>> That option could be used to provide a way for users to be able to
>> switch to the Maven 2 management behaviour. Maybe with this option in
>> place it would make sense to log warnings whenever this option is used
>> providing guidance for changing POMs.
>
> We could also release Maven 3.4.0 as Maven 4.0.0 to make things clear
> and change the dependency management to whatever behaviour seems to be
> the most useful. What we now have on master is just consistent to what
> has been documented. The non-transitive scopes start to work correctly.
> That means you need to make all transitive dependencies with those
> scopes direct dependencies. For 'provided' and 'optional', it makes
> sense. If it makes sense for the 'test' scope is questionable. I do not
> know the reason for the 'test' scope to be non-transitive. Can someone
> clarify that?

I would strongly prefer ALL depenency resolution (code- and/or 
documentation-wise) to be fixed and rebrand to 4.0.0. There is some much 
cleanup that this cannot be a minor, even if you doing the right thing.

All other changes planned for 4.0, like Model 5, etc. can be postponed 
easily to Maven 5.0.

Christian, thank you very much for the in-depth analysis on the issues 
raised over the last couple of weeks on the mailing list. As well as the 
code reviews and fixes.

Michael


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


Re: maven-wagon git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management.

Posted by Christian Schulte <cs...@schulte.it>.
Am 12/15/16 um 00:19 schrieb Christian Schulte:
>  -ldm,--legacy-dependency-management
> Use Maven 2 dependency management behaviour. Can also be activated by
> using -Dmaven.legacyDependencyManagement=true.
> 
> There are a bunch of issues in JIRA affecting dependency management.
> That option could be used to provide a way for users to be able to
> switch to the Maven 2 management behaviour. Maybe with this option in
> place it would make sense to log warnings whenever this option is used
> providing guidance for changing POMs.

We could also release Maven 3.4.0 as Maven 4.0.0 to make things clear
and change the dependency management to whatever behaviour seems to be
the most useful. What we now have on master is just consistent to what
has been documented. The non-transitive scopes start to work correctly.
That means you need to make all transitive dependencies with those
scopes direct dependencies. For 'provided' and 'optional', it makes
sense. If it makes sense for the 'test' scope is questionable. I do not
know the reason for the 'test' scope to be non-transitive. Can someone
clarify that?

Regards,
-- 
Christian


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


Re: maven-wagon git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management.

Posted by Christian Schulte <cs...@schulte.it>.
Am 12/14/16 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

Correct. It's a transitive dependency of 'wagon-provider-test' with
'test' scope.

> 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...

The 'test' scope from dependency management had been overridden
everywhere to 'compile'. Managing it to 'test' during resolution and
overriding it everywhere to 'compile' (model builder, see A below) makes
no sense.

> 
> 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.

I can only comment on what the code is doing. Dependency management is
implemented in two different places.

A) The model builder uses the information from the dependency management
to update elements of dependencies without a value. This has nothing to
do with resolution. The model builder just copies missing elements from
the dependency management to the dependencies when building the
effective model. The model builder will not apply the management
information to dependencies overriding the management values in the
effective model. This appears to be inconsistent to what the resolver does.

B) The dependency management also is passed to the resolver and is used
to manage all dependency elements, regardless of what the model builder
provides (ArtifactDescriptorReader calls the model builder). It has
always been that way. Going into details here means we need to discuss
dependency management as it got introduced in Maven 2.0.x. When Maven
2.0 got released, dependency management had not been implemented.
Someone provided a patch via JIRA making it "work somehow". Browsing to
"Versions" in the MNG project in JIRA shows no 2.x versions anymore. I
cannot look this up. I think that patch got applied and released with
Maven 2.0.6. I am not sure this is the correct version. From there on,
it had always been kept compatible to that patch but has never been
working as intendet. Everyone got used to it that way so anything making
it behave differently will appear to be something unintended.

<https://git-wip-us.apache.org/repos/asf?p=maven-resolver.git;a=blob;f=maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManager.java;h=fefb9fbb563ea58a1d454a80e492395ac4df7ad6;hb=HEAD>

> 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.

As others have suggested, we maybe need to provide a command line option
for this. It's not only the 'test' scope. It's also about 'provided' and
'optional'. Anything non-transitive is affected. There also is the
change from 'ClassicDependencyManager' to 'TransitiveDependencyManager'
and other bugfixes to dependency management. We already have
--legacy-local-repository, so we maybe should just add

 -ldm,--legacy-dependency-management
Use Maven 2 dependency management behaviour. Can also be activated by
using -Dmaven.legacyDependencyManagement=true.

There are a bunch of issues in JIRA affecting dependency management.
That option could be used to provide a way for users to be able to
switch to the Maven 2 management behaviour. Maybe with this option in
place it would make sense to log warnings whenever this option is used
providing guidance for changing POMs.

Regards,
-- 
Christian


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


Re: maven-wagon git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management.

Posted by Robert Scholte <rf...@apache.org>.
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.

thanks,
Robert


On Wed, 14 Dec 2016 17:57:47 +0100, Robert Scholte <rf...@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, <sc...@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 <sc...@apache.org>
>> Authored: Wed Dec 14 00:41:02 2016 +0100
>> Committer: Christian Schulte <sc...@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-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

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


Re: maven-wagon git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management.

Posted by Michael Osipov <mi...@apache.org>.
Am 2016-12-14 um 18:14 schrieb Christian Schulte:
> Am 12/14/16 um 17:57 schrieb Robert Scholte:
>> 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)
>
> When managing a transitive dependency to 'test' scope, that transitive
> dependency must not be resolved the same way it would not be resolved
> when set to 'test' scope directly.
>
> A -> B (test) -> C (test)
>
> When resolving A, B and C will not be resolved.
>
> A (manages B and C to test) -> B (managed to test) -> C (managed to test)
>
> When resolving A, B and C will not be resolved. Currently they are
> resolved due to a bug. Bugfix makes the 'test' scope consistently
> non-transitive. The real issue behind this is: "Why is test scope not
> transitive?".

After rereading 
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html, 
it perfectly makes sense what you are saying and the question you are 
asking.

Michael


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


Re: maven-wagon git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management.

Posted by Christian Schulte <cs...@schulte.it>.
Am 12/14/16 um 17:57 schrieb Robert Scholte:
> 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)

When managing a transitive dependency to 'test' scope, that transitive
dependency must not be resolved the same way it would not be resolved
when set to 'test' scope directly.

A -> B (test) -> C (test)

When resolving A, B and C will not be resolved.

A (manages B and C to test) -> B (managed to test) -> C (managed to test)

When resolving A, B and C will not be resolved. Currently they are
resolved due to a bug. Bugfix makes the 'test' scope consistently
non-transitive. The real issue behind this is: "Why is test scope not
transitive?".

Regards,
-- 
Christian


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


Re: maven-wagon git commit: [MRESOLVER-9] DefaultDependencyCollector does not correctly handle dependency management.

Posted by Robert Scholte <rf...@apache.org>.
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, <sc...@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 <sc...@apache.org>
> Authored: Wed Dec 14 00:41:02 2016 +0100
> Committer: Christian Schulte <sc...@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-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org