Merge branch '2.3.x'

Closes gh-22202
This commit is contained in:
Andy Wilkinson
2020-07-02 15:17:04 +01:00
4 changed files with 80 additions and 11 deletions

View File

@@ -86,6 +86,11 @@ class BootJarIntegrationTests extends AbstractBootArchiveIntegrationTests {
.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
}
@TestTemplate
void layersWithCustomSourceSet() throws IOException {
assertThat(this.gradleBuild.build("bootJar").task(":bootJar").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
}
@TestTemplate
void implicitLayers() throws IOException {
writeMainClass();

View File

@@ -0,0 +1,36 @@
plugins {
id 'java'
id 'org.springframework.boot' version '{version}'
}
sourceSets {
custom
}
bootJar {
mainClassName = 'com.example.Application'
layered()
}
repositories {
mavenCentral()
maven { url "file:repository" }
}
dependencies {
implementation("com.example:library:1.0-SNAPSHOT")
implementation("org.apache.commons:commons-lang3:3.9")
implementation("org.springframework:spring-core:5.2.5.RELEASE")
}
task listLayers(type: JavaExec) {
classpath = bootJar.outputs.files
systemProperties = [ "jarmode": "layertools" ]
args "list"
}
task extractLayers(type: JavaExec) {
classpath = bootJar.outputs.files
systemProperties = [ "jarmode": "layertools" ]
args "extract"
}