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

Many of our internal libraries using dependency with classifier, something like
’com.x:artifact:1.0.0:classifier’ and now we get rid of the classifier in the new version.
But now i need to force gradle to ignore all the transitive dependencies and add just

I’m able to remove the dependency globally by

configurations {
all*.exclude group: “com.x”, module: “artifact”

But then I can’t add it back. So I need to remove just transition, not direct dependencies.

I tried resolutionStrategy with force and it also doesn’t work.

I tried to use also this:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        if ( == 'artifact') {
            details.useTarget group:, name:, version: "3.0.0"                details.because "We want to use version 3.0.0 without classfier"

And it also doesn’t help, it looking for the new version, but still with classifier.

configurations.all {
    exclude module: "artifact"
    resolutionStrategy.force "com.x:artifact:3.0.0"

also doesn’t help, exclude is still more strong than force and dependency is completely missing.

Really no way how to replace one dependency by the same one just without classifier?