spring-boot/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/build.gradle
Phillip Webb b42f056ddb Don't close jar files early
Update `JarFile` and related classes so that `close()` is not longer
called early.

Prior to this commit, we would always immediately close the underlying
jar file to prevent file locking issues with our build. This causes
issues on certain JVMs when they attempt to verify a signed jar.

The file lock issues have now been solved by returning a custom input
stream from `JarUrlConnection` which captures and delegates the close
method.

Fixes gh-29356
2022-06-15 10:51:01 -07:00

58 lines
2.2 KiB
Groovy

plugins {
id "java"
id "org.springframework.boot.conventions"
id "org.springframework.boot.integration-test"
}
description = "Spring Boot Loader Integration Tests"
configurations {
app
}
dependencies {
app project(path: ":spring-boot-project:spring-boot-dependencies", configuration: "mavenRepository")
app project(path: ":spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin", configuration: "mavenRepository")
app project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-web", configuration: "mavenRepository")
app project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter", configuration: "mavenRepository")
app("org.bouncycastle:bcprov-jdk15on:1.70")
intTestImplementation(enforcedPlatform(project(":spring-boot-project:spring-boot-parent")))
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
intTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
intTestImplementation("org.testcontainers:junit-jupiter")
intTestImplementation("org.testcontainers:testcontainers")
}
task syncMavenRepository(type: Sync) {
from configurations.app
into "${buildDir}/int-test-maven-repository"
}
task syncAppSource(type: org.springframework.boot.build.SyncAppSource) {
sourceDirectory = file("spring-boot-loader-tests-app")
destinationDirectory = file("${buildDir}/spring-boot-loader-tests-app")
}
task buildApp(type: GradleBuild) {
dependsOn syncAppSource, syncMavenRepository
dir = "${buildDir}/spring-boot-loader-tests-app"
startParameter.buildCacheEnabled = false
tasks = ["build"]
}
task syncSignedJarUnpackAppSource(type: org.springframework.boot.build.SyncAppSource) {
sourceDirectory = file("spring-boot-loader-tests-signed-jar-unpack-app")
destinationDirectory = file("${buildDir}/spring-boot-loader-tests-signed-jar-unpack-app")
}
task buildSignedJarUnpackApp(type: GradleBuild) {
dependsOn syncSignedJarUnpackAppSource, syncMavenRepository
dir = "${buildDir}/spring-boot-loader-tests-signed-jar-unpack-app"
startParameter.buildCacheEnabled = false
tasks = ["build"]
}
intTest {
dependsOn buildApp, buildSignedJarUnpackApp
}