mojohaus / extra-enforcer-rules

Extra Enforcer Rules
https://www.mojohaus.org/extra-enforcer-rules/
Apache License 2.0
73 stars 47 forks source link

banDuplicateClasses incorrectly finds duplicates #302

Open wilx opened 4 months ago

wilx commented 4 months ago

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.