[GRADLE-2763] Setting/changing classifier in dependency resolve rule Created: 06/May/13  Updated: 06/Feb/17  Resolved: 06/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Task
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Duplicate Votes: 9


 Description   

I assumed it would be rather easy with code like this:

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def req = details.requested
if(req.group == 'org.codehaus.groovy') {
details.useTarget group: req.group, name: req.name, version: req.version, classifier: 'indy'
}
}
}

But I've since found out that ModuleVersionSelector does not have a classifier property.

How can I achieve this?

(I think this would be an ideal resolution example for the documentation, btw.)



 Comments   
Comment by Joseph Athman [ 24/Oct/14 ]

Any possibility of getting this included in 2.2? I'd like to have this feature to be able to force the usage of the groovy-all library with invoke dynamic support (classifier: indy).

Comment by Wesley Hartford [ 03/Mar/15 ]

I would also love this enhancement. I'm trying to replace all use of guice with the no_aop flavour of guice.

Comment by Sebastian Schuberth [ 10/Aug/16 ]

I was looking into implementing this, but simply adding getClassifier() to ModuleVersionSelector does not seem right to me as a classifier is a property of an (Maven) artifact, not of a (Maven) module. Any opinions on that?

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Sebastian Schuberth [ 15/Nov/16 ]

I'm still interested in this as being able to change the classifier would provide an easy way to e.g. download the source code of all dependencies (for license scans) by setting the classifier to "sources".

Comment by Benjamin Muschko [ 06/Feb/17 ]

The issue is now tracked via https://github.com/gradle/gradle/issues/1340.

Generated at Wed Jun 30 12:30:50 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.