Setting/changing classifier in dependency resolve rule

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

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

OK, thanks.