-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consider changes to a dependency's target when managing its version
Previously, dependency management was determined used the requested selector. This meant that any changes made to the target selector were ignored. This would cause a problem if an earlier resolution strategy had changed the group ID or artifact ID of the dependency as the managed version would be determined using the original coordinates not the updated coordinates. This commit applies managed versions using the target selector, thereby ensuring that any earlier changes to the target are taken into account when determining the managed version. Fixes gh-383
- Loading branch information
1 parent
19824b8
commit e722715
Showing
3 changed files
with
66 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ment/DMPIT/whenDependencyIsSubstitutedNewCoordinatesAreUsedForDependencyManagement.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
buildscript { | ||
project.configurations.all { | ||
resolutionStrategy.eachDependency { | ||
if (requested.group == "org.bouncycastle" && requested.name == "bcprov-jdk15on") { | ||
useTarget("org.bouncycastle:bcprov-jdk18on:1.78.1") | ||
} | ||
} | ||
} | ||
} | ||
|
||
plugins { | ||
id "java" | ||
id "io.spring.dependency-management" | ||
} | ||
|
||
/* | ||
configurations.all { | ||
resolutionStrategy.eachDependency { | ||
if (requested.group == "org.bouncycastle" && requested.name == "bcprov-jdk15on") { | ||
useTarget("org.bouncycastle:bcprov-jdk18on:1.78.1") | ||
} | ||
} | ||
} | ||
*/ | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("org.bouncycastle:bcprov-jdk15on:1.70") | ||
} | ||
|
||
task resolve { | ||
doFirst { | ||
def files = project.configurations.compileClasspath.resolve() | ||
def output = new File("${buildDir}/resolved.txt") | ||
output.parentFile.mkdirs() | ||
files.collect { it.name }.each { output << "${it}\n" } | ||
} | ||
} |