[GRADLE-3524] configurations.compile.resolutionStrategy ignored Created: 17/Aug/16  Updated: 13/Sep/16  Resolved: 13/Sep/16

Status: Resolved
Project: Gradle
Affects Version/s: 2.10, 3.0
Fix Version/s: None

Type: Improvement
Reporter: Donát Csikós Assignee: Unassigned
Resolution: Won't Fix Votes: 0

Issue Links:
Related to GRADLE-2656 dependencies inherited from other con... Resolved


Original report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=499728

Snapshot dependencies in the compile scope don't get updated, even if cacheChangingModulesFor is set to 0.

dependencies {
    compile 'example:lib:1.0.0-SNAPSHOT'

configurations.compile.resolutionStrategy {
    cacheChangingModulesFor 0, 'seconds'

Seems like that the testRuntime configuration is actually resolved: if the configurations.testRuntime.resolutionStrategy is configured then the problem disappears.

Comment by Stefan Wolf [ 26/Aug/16 ]

This is the case since Gradle 2.10, at least. So it is not a regression. We probably should do something about it, anyway. The issue is that if you configure a resolutionStrategy for one configuration, then a configuration extending this one does not use this resolutionStrategy.

The correct behavior would probably to also "extend" the resolutionStrategy when extending the Configuration. This would probably also be a good idea for dependency substitution and similar features.

Currently, using these features of resolutionStrategy should only happen globally, i.e. for all configurations.

Comment by Hugh Greene [ 01/Sep/16 ]

This seems like a duplicate of https://issues.gradle.org/browse/GRADLE-2656, which has a comment saying "this is by design", but hasn't been closed as "wontfix" or similar.

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