Resolve Current Spring Version

Issue gh-7788
This commit is contained in:
Rob Winch 2020-01-06 15:12:04 -06:00
parent 65981444f1
commit f639e17491
1 changed files with 8 additions and 2 deletions

View File

@ -36,7 +36,7 @@ dependencies {
task springVersion(type: versions.VersionsResourceTasks) {
versionsFile = file("${buildDir}/versions/spring-security.versions")
versions = provider { ["org.springframework:spring-core":"$springVersion"] }
versions = provider { ["org.springframework:spring-core":"${springVersion()}"] }
}
tasks.processResources {
@ -52,6 +52,12 @@ tasks.sourcesJar.from {includeProject.sourceSets.main.java}
configure(project.tasks.withType(Test)) {
doFirst {
systemProperties['springSecurityVersion'] = version
systemProperties['springVersion'] = springVersion
systemProperties['springVersion'] = springVersion()
}
}
String springVersion() {
println project.configurations.compile.resolvedConfiguration.resolvedArtifacts.collect { it.name }
return project.configurations.compile.resolvedConfiguration.resolvedArtifacts
.find { it.name == 'spring-core' }.moduleVersion.id.version
}