Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Given this innocent POM snippet:
<dependencyManagement> <dependencies> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-model</artifactId> <version>2.0.6</version> <exclusions> <exclusion> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> </exclusion> </exclusions> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-model</artifactId> <exclusions> <exclusion> <groupId>foo</groupId> <artifactId>bar</artifactId> </exclusion> </exclusions> </dependency> </dependencies>
What will be the effective exclusions applied to the dependencies of maven-model?
It depends on the context in which the POM is processed. Technically, the two exclusions are not merged in the effective POM (right now, the effective POM only propagates managed exclusions to a dependency if the dependency has no exclusions declared). However, for a local project POM, the artifact collector superimposes the exclusion of plexus-utils from the dependency management onto the maven-model artifact such that eventually both exclusions apply during dependency resolution. In contrast, for a dependency POM, this superimposition does not happen, such that exclusions from dependency management do not apply to dependencies that by themselves have already exclusions specified.
Attachments
Issue Links
- is related to
-
MNG-5761 Dependency management is not transitive.
- Closed