[ 
https://issues.apache.org/jira/browse/MNG-7773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17716737#comment-17716737
 ] 

Max Schaefer commented on MNG-7773:
-----------------------------------

Same problem when building with:

Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8)

Apache Maven 4.0.0-alpha-5 (26d10a4bf9a2df75feef60da01d8706f2bf77a47)

> Exclusion inside a transitive dependency overrides global visibility of 
> excluded dependency
> -------------------------------------------------------------------------------------------
>
>                 Key: MNG-7773
>                 URL: https://issues.apache.org/jira/browse/MNG-7773
>             Project: Maven
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 3.8.8
>         Environment: Apache Maven 3.8.8 
> (4c87b05d9aedce574290d1acc98575ed5eb6cd39)
> Maven home: C:\DEV\apache-maven
> Java version: 11.0.17, vendor: Amazon.com Inc., runtime: 
> C:\DEV\amazon-corretto-windows-x64-jdk-javafx-11.0.17.8.1
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
>            Reporter: Max Schaefer
>            Priority: Major
>         Attachments: dependencyTestWithFailure.zip
>
>
> The attached example project has basically these maven dependencies:
> {code:java}
> sample.ProjectX:Project-X:jar
> \- sample.ProjectY:Project-Y:jar
>    \- sample.ProjectB:Project-B:jar
>       \- sample.ProjectC:Project-C:jar
>          \- sample.ProjectD:Project-D:jar
> \- sample.ProjectA:Project-A:jar
>    \- sample.ProjectC:Project-C:jar {code}
> In Project-X there is class X which uses class D from Project-D
> However, in Project-A's pom there is an exclusion of Project-D on dependency 
> of Project-C 
> That is causing Project-D to disappear from the build path of Project-X 
> causing the build to fail.
> When removing dependency of Project-A from Project-X then the build works 
> fine.
> I believe the exclusion on Project-A pom should not cause Project-D to be 
> excluded also from Project-X build path.
> The attached project is just to demo the problem that when adding some 
> third-party dependency to my pom some other transitive dependency can 
> inexpertly disappear from my dependencies.
> Especially on huge projects with lots of dependencies this can be very tricky 
> to spot.
> The disappeared dependency might contain stuff just needed at runtime by the 
> depending third-party (so not my own project).
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to