maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schulte ...@schulte.it>
Subject Re: Dependency resolution broken on Wagon master with Maven 3.4.0-SNAPSHOT
Date Thu, 15 Dec 2016 08:22:43 GMT
Am 12/15/16 um 09:16 schrieb Christian Schulte:
> Am 12/15/16 um 07:53 schrieb Stephen Connolly:
>> That may be at odds with the code and docs but it is the only think that
>> makes sense to me, depMgmt is about managing dependencies... the bit you
>> want to manage is versions and exclusions, everything else is just the
>> matching as I see it
> 
> Maven core and the resolver handle this differently. In the core, only
> the elements from dependency management are copied to the dependencies,
> not overridden or provided at dependency level. In the resolver, all
> elements of a dependency get overridden by the management information,
> regardless of what has been in the model.

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>GID</groupId>
      <artifactId>AID</artifactId>
      <version>1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

<dependency>
  <groupId>GID</groupId>
  <artifactId>AID</artifactId>
</dependency>

ModelBuilder: Will copy scope and version to the dependency. No scope
means default scope (compile). If this is the intended scope, it needs
to be overridden explicitly for the ModelBuilder to not copy the scope
from the managenent. Same for the version. Like so:


<dependency>
  <groupId>GID</groupId>
  <artifactId>AID</artifactId>
  <scope>compile</scope>
</dependency>

The resolver will still manage the scope to 'test' on that dependency.
Same for the version. If that dependency would have a <version>, the
ModelBuilder would not apply the managed version, the resolver would.


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


Mime
View raw message