Dependency substitution with more complex dependencies

In my project I have dependencies that contain more than just Group ID, Artifact ID and Version, they also have a classifier and extension.
Now, I’d like to use the new dependency substitution feature:

resolutionStrategy.dependencySubstitution.all { DependencySubstitution dependency ->
    if (dependency.requested instanceof ModuleComponentSelector && dependency.requested.group == 'my.group.id') {
        def targetProject = findProject(":${dependency.requested.module}")
        if (targetProject != null) {
            dependency.useTarget targetProject
        }
    }
}

How would I specify the classifier and extension?

1 Like