Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow dependency resolve rule to influence variant selection #1340
Original issue: https://issues.gradle.org/browse/GRADLE-2763
A dependency resolve rule can set or change the classifier attribute or a requested module.
Only the attributes
Enforcing a module with a specific classifier.
I ran into this for the
Dependency management in Gradle has now established the use of variants as a better solution to this problem.
Updating the title to reflect the direction of a possible fix.
I am not sure if we want to add more variant awareness to resolve rules. I think the use cases should rather be solved without resolve rules if possible. So if we need to do something at all here, I would currently tend to do what was originally requested (if it is easy to do).
But to concretely answer @paplorinc question and offer alternative solutions:
In the case described in this issue, where a transitive dependency already brought in the other variant of guice, you'll probably end up with a conflict. This can then be resolved like this:
Or you add another metadata rule 'correcting' the dependencies in the metadata of whatever brought in the 'wrong' variant.
Note you need Gradle 6 (RC will be available shortly) for this.