extra-enforcer-rules
extra-enforcer-rules copied to clipboard
banDuplicateClasses incorrectly finds duplicates
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.