slawekjaranowski commented on issue #1598:
URL: 
https://github.com/apache/maven-dependency-plugin/issues/1598#issuecomment-4480314980

   In parent of hadoop projects 
https://central.sonatype.com/artifact/org.apache.hadoop/hadoop-project/3.4.3 we 
have:
   
   ```xml
   <dependencyManagement>
     <dependency>
           <groupId>org.apache.hadoop</groupId>
           <artifactId>hadoop-common</artifactId>
           <version>${hadoop.version}</version>
           <exclusions>
             <exclusion>
               <groupId>org.slf4j</groupId>
               <artifactId>slf4j-reload4j</artifactId>
             </exclusion>
           </exclusions>
       </dependency>
   </dependencyManagement>
   ```
   
   in standard way dependencyManagement is not transitivy .. so we have 
(without exclusion):
   
   ````
   mvn -V dependency:tree -Dincludes=org.slf4j
   Apache Maven 3.9.15 (98b2cdbfdb5f1ac8781f537ea9acccaed7922349)
   
   [INFO] --- dependency:3.11.0-SNAPSHOT:tree (default-cli) @ test ---
   [INFO] org.apache.maven.its.dependency:test:jar:1.0-SNAPSHOT
   [INFO] \- org.apache.hadoop:hadoop-client:jar:3.4.3:compile
   [INFO]    \- org.apache.hadoop:hadoop-common:jar:3.4.3:compile
   [INFO]       +- org.slf4j:slf4j-api:jar:1.7.36:compile
   [INFO]       \- org.slf4j:slf4j-reload4j:jar:1.7.36:compile
   ````
   
   and with Maven 3.10 (or 4.x default) we can try:
   
   ```
   mvn -V dependency:tree -Dmaven.resolver.dependencyManagerTransitivity=true 
-Dincludes=org.slf4j
   Apache Maven 3.10.0-SNAPSHOT (128f64b867f55e67cf0e6267507491f655eefa38)
   
   [INFO] --- dependency:3.11.0-SNAPSHOT:tree (default-cli) @ test ---
   [INFO] org.apache.maven.its.dependency:test:jar:1.0-SNAPSHOT
   [INFO] \- org.apache.hadoop:hadoop-client:jar:3.4.3:compile
   [INFO]    \- org.apache.hadoop:hadoop-common:jar:3.4.3:compile
   [INFO]       \- org.slf4j:slf4j-api:jar:1.7.36:compile
   ```
   
   I dont know why and how code 
`org.apache.maven.plugins.dependency.utils.ResolverUtil#collectDependencies`
   
   ```java
   
           CollectRequest request =
                   new CollectRequest(root, 
session.getCurrentProject().getRemoteProjectRepositories());
           CollectResult result = 
repositorySystem.collectDependencies(session.getRepositorySession(), request);
   ```
   
   respect depManagment from transitive dependencies
   
   only @cstamas can help I think ....
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to