The result of ‘gradle dependencies’ has no information about a classifier of a given package. That causes that a developer is not able to simply determine if given package is for example ‘groovy-all’ or ‘groovy-all-indy’.
Gradle seems to resolve that internally correctly, but that can be a real problem as for example InnteliJ Idea treats ‘groovy-all’ and ‘groovy-all-indy’ (being a transitive dependencies) treats them as two separate packages and adds both as project dependencies (what generate conflicts) - it is hard to find where rogue dependency comes from.
In addition it seems to be a problem to write a ‘ResolutionStrategy’ which would replace all ‘groovy-all-indy’ to ‘groovy-all’ as there is used ‘DependencyResolveDetails’ -> ‘ModuleVersionSelector’ which doesn’t have the ‘classifier’ field (only group, name and version).
The reason for this behavior is that ‘gradle dependencies’ shows Maven/Ivy modules, whereas a classifier only applies to a module’s main artifact. The module name for ‘org.codehaus.groovy:groovy-all:2.3.5:indy’ (which isn’t the same as ‘org.codehaus.groovy:groovy-all-indy:2.3.5’) is still ‘groovy-all’.
Thanks Peter for your reply.
Maybe ‘gradle dependencies’ could show real artifact which is used? Sometimes it does matter that ‘foo-1.2.3-tests.jar’ is a dependency in a test scope not ‘foo-1.2.3.jar’.
Is it possible to get the information about a classifier at a ‘ResolutionStrategy’ level (or anywhere else before it is not too late to change them)?
I don’t think that artifacts can/should be shown, but perhaps the classifier could be shown even though it’s not part of the module id. I’m not aware of a way to modify classifiers via ‘ResolutionStrategy’, or classifiers of transitive dependencies in general. (For a direct dependency you could modify the dependency declaration.)
How to configure properly gradle project to use ‘groovy-all:2.3.5:indy’ without duplicating groovy jar (normal and indy) into generated jar?