Open Dave562CZ opened 2 years ago
An ugly workaround is to use excludes to put org.codehaus
artifacts out of the picture.
Thank you for providing a valid reproducer.
The issue is in the backlog of the relevant team but the existence of a workaround makes it non-critical so it might take a while before a fix is made.
When having both groovy 4 and groovy 3 (as transitive dependency) on the groovy compile classpath with custom GroovyVersionAlignment rule, during compilation both versions of groovy end up on classpath even though groovy 4 has defined org.codehaus.groovy:* capabilities. Different wrong results were observed by changing direct dependency to groovy:4, groovy-all:4 and both of them at the same time
Expected Behavior
Only groovy 4 should be on classpath with all groovy modules aligned to same version no matter if direct dependency is on just some groovy modules or all
Current Behavior
Both versions of groovy end up on classpath
Context
All modules of groovy needs to be aligned across all modules and transitive dependencies, no matter if there is only subset or superset of modules as direct dependencies compared to transitive dependencies of that module.
Steps to Reproduce
Reproducer project: https://github.com/Dave562CZ/gradle-groovy-4-resolution Also discussed here: https://linen.dev/s/gradle-community/t/4966276/hello-with-groovy-changing-its-gav-coordinates-with-version-
Your Environment
Build scan URL: https://scans.gradle.com/s/kjeakc4dshniw