Here is a test project that demonstrates the issue: https://github.com/wilx/dup-classes-test/tree/master/ This project consists of a lib artifact which simulates jakarta.servlet-api being included in some 3rd party transitive library in compile scope. Then there is a dup-classes-test project, which utilizes lib and also declares jakarta.servlet-api in provided scope which should win and all references of the jakarta.servlet-api should be referencing this one in the provided scope. The dependency:tree agrees with this:
The problem seems to be that it does not correctly filter out jakarta.servlet-api artifact in the compile scope in the transitive dependency.
Here is a test project that demonstrates the issue: https://github.com/wilx/dup-classes-test/tree/master/ This project consists of a
lib
artifact which simulatesjakarta.servlet-api
being included in some 3rd party transitive library incompile
scope. Then there is adup-classes-test
project, which utilizeslib
and also declaresjakarta.servlet-api
inprovided
scope which should win and all references of thejakarta.servlet-api
should be referencing this one in theprovided
scope. Thedependency:tree
agrees with this:The problem seems to be that it does not correctly filter out
jakarta.servlet-api
artifact in thecompile
scope in the transitive dependency.