spring-boot/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle
Andy Wilkinson b34a311d02 Rework dep management to avoid consumers picking up strict constraints
Previously, enforcedPlatform dependencies were using to pull in the
constraints defined in spring-boot-dependencies and
spring-boot-parent and applied them strictly so that the constrained
version had to be used. This worked as intended in Spring Boot's own
build but incorrectly enforced those same strict version requirements
on external consumers of Spring Boot's modules.

This commit reworks how Spring Boot defines its internal dependency
management so that platform dependencies are exposed to external
consumers while enforced platform dependencies are using internally.

See gh-19609
2020-01-13 19:59:56 +00:00

52 lines
1.3 KiB
Groovy

plugins {
id 'java-library'
id 'org.springframework.boot.conventions'
id 'org.springframework.boot.deployed'
id 'org.springframework.boot.internal-dependency-management'
}
description = 'Spring Boot Loader Tools'
def generatedResources = "${buildDir}/generated-resources/main"
configurations {
loader
}
dependencies {
api platform(project(':spring-boot-project:spring-boot-dependencies'))
api "org.apache.commons:commons-compress:1.19"
compileOnly "ch.qos.logback:logback-classic"
implementation "org.springframework:spring-core"
loader project(":spring-boot-project:spring-boot-tools:spring-boot-loader")
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter"
testImplementation "org.mockito:mockito-core"
testImplementation "org.zeroturnaround:zt-zip:1.13"
}
sourceSets {
main {
output.dir(generatedResources, builtBy: 'reproducibleLoaderJar')
}
}
task reproducibleLoaderJar(type: Jar) {
dependsOn configurations.loader
from {
zipTree(configurations.loader.incoming.files.filter {it.name.startsWith "spring-boot-loader" }.singleFile)
}
reproducibleFileOrder = true
preserveFileTimestamps = false
archiveFileName = 'spring-boot-loader.jar'
destinationDirectory = file("${generatedResources}/META-INF/loader")
}
jar {
dependsOn reproducibleLoaderJar
}