Merge branch '2.3.x'
Closes gh-22202
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user