Remove transitive dependency with classifier and replace with new one without classifier

This works, thanks! In my case I needed to remove the classifier, so the syntax ended up like:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        if (details.requested.module.toString() == "commons-beanutils:commons-beanutils") {
            details.artifactSelection{
                it.selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null)
            }
        }
    }
}