Support flat jar layering with Gradle

Update the Gralde plugin so that layered jars now use the regular "flat"
format. The layers.idx file now describes which layer each file should
be placed.

See gh-20813

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
This commit is contained in:
Andy Wilkinson
2020-04-02 22:44:56 -07:00
committed by Phillip Webb
parent 4e3cdf936f
commit bfa04e6574
10 changed files with 334 additions and 188 deletions

View File

@@ -31,6 +31,19 @@ repositories {
}
dependencies {
implementation("org.apache.commons:commons-lang3:3.9")
implementation("commons-io:commons-io:2.7-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"
}

View File

@@ -14,6 +14,19 @@ repositories {
}
dependencies {
implementation("org.apache.commons:commons-lang3:3.9")
implementation("commons-io:commons-io:2.7-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"
}