Substitute dependency module with alternative configuration


(Olexandr Tereshchuk) #1

We may set a dependency with alternative target configuration:

dependencies {
runtime group: ‘org.somegroup’, name: ‘somedependency’, version: ‘1.0’, configuration: ‘someConfiguration’

Is there any way to change someConfiguration to something different ?
I’ve tried different ways of dependency substitution (or rejecting) using resolutionStrategy, but it does not expose target configuration (someConfiguration) information - we just have access to the group, module and version.

P.S. Real life example:
I have multiple libraries that define

compile “org.threeten:threetenbp:1.3.3:no-tzdb”

I don’t want to write tons of exclude expression, but instead I want to replace this dependency in a single place with

compile “org.threeten:threetenbp:1.3.3”