Setting/changing classifier in dependency resolve rule


(Jörn Huxhorn) #1

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.)


(Peter Niederwieser) #2

‘groovy-indy’ is indeed a good use case. Apparently, setting a classifier isn’t supported yet. I’ve raised this as GRADLE-2763.


(Jörn Huxhorn) #3

OK, thanks.