[GRADLE-2656] dependencies inherited from other configurations do not respect original resolution strategy Created: 26/Jan/13  Updated: 12/Sep/16  Resolved: 12/Sep/16

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Szczepan Faber Assignee: Unassigned
Resolution: Won't Fix Votes: 0

Issue Links:
Related
Related to GRADLE-3524 configurations.compile.resolutionStra... Resolved

 Description   
apply plugin: 'java'
repositories { mavenCentral() }
dependencies {
  compile 'log4j:log4j:1.2.15'
}
configurations.compile.resolutionStrategy.force 'log4j:log4j:1.2.17'
//dependencies --configuration compile yields:
log4j:log4j:1.2.15 -> 1.2.17

//dependencies --configuration runtime yields:
log4j:log4j:1.2.15

Runtime configuration extend compile configuration so I would expect it use resolution strategy rules for dependencies declared in 'compile' configuration. This is certainly the case for other configuration tweaks, for example 'exclusions' of the original configuration are used in the target configuration.

This problem also exists for newly added dependency resolve rules feature.

Workaround

Apply resolution strategy tweaks to all configurations:

configurations.all { 
  resolutionStrategy {
    ...
  }
}


 Comments   
Comment by Adam Murdoch [ 30/Apr/13 ]

This is by design. Each configuration is a separate resolve context that you can tweak the strategy for separately.

Generated at Wed Jun 30 12:27:51 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.