Refine layer customization for Maven and Gradle
Simplify layer customization logic for both Maven and Gradle and refactor some internals of the Gradle plugin. Both Maven and Gradle now use a simpler customization format that consists of `application`, `dependencies` and `layer order` sections. The `application`, `dependencies` configurations support one or more `into` blocks that are used to select content for a specific layer. Closes gh-20526
This commit is contained in:
@@ -9,27 +9,17 @@ bootJar {
|
||||
|
||||
// tag::layered[]
|
||||
bootJar {
|
||||
layers {
|
||||
layersOrder "dependencies", "snapshot-dependencies", "application"
|
||||
libraries {
|
||||
layerContent("snapshot-dependencies") {
|
||||
coordinates {
|
||||
include "*:*:*SNAPSHOT"
|
||||
}
|
||||
}
|
||||
layerContent("dependencies") {
|
||||
coordinates {
|
||||
include "*:*"
|
||||
}
|
||||
}
|
||||
}
|
||||
layered {
|
||||
application {
|
||||
layerContent("application") {
|
||||
locations {
|
||||
include "**"
|
||||
}
|
||||
}
|
||||
intoLayer("application")
|
||||
}
|
||||
dependencies {
|
||||
intoLayer("snapshot-dependencies") {
|
||||
include "*:*:*SNAPSHOT"
|
||||
}
|
||||
intoLayer("dependencies")
|
||||
}
|
||||
layerOrder "dependencies", "snapshot-dependencies", "application"
|
||||
}
|
||||
}
|
||||
// end::layered[]
|
||||
|
||||
@@ -7,27 +7,17 @@ plugins {
|
||||
|
||||
// tag::layered[]
|
||||
tasks.getByName<BootJar>("bootJar") {
|
||||
layers {
|
||||
layersOrder("dependencies", "snapshot-dependencies", "application")
|
||||
libraries {
|
||||
layerContent("snapshot-dependencies") {
|
||||
coordinates {
|
||||
include("*:*:*SNAPSHOT")
|
||||
}
|
||||
}
|
||||
layerContent("dependencies") {
|
||||
coordinates {
|
||||
include("*:*")
|
||||
}
|
||||
}
|
||||
}
|
||||
layered {
|
||||
application {
|
||||
layerContent("application") {
|
||||
locations {
|
||||
include("**")
|
||||
}
|
||||
}
|
||||
intoLayer("application")
|
||||
}
|
||||
dependencies {
|
||||
intoLayer("snapshot-dependencies") {
|
||||
include("*:*:*SNAPSHOT")
|
||||
}
|
||||
intoLayer("dependencies") {
|
||||
}
|
||||
layersOrder("dependencies", "snapshot-dependencies", "application")
|
||||
}
|
||||
}
|
||||
// end::layered[]
|
||||
|
||||
@@ -9,6 +9,6 @@ bootJar {
|
||||
|
||||
// tag::layered[]
|
||||
bootJar {
|
||||
layers()
|
||||
layered()
|
||||
}
|
||||
// end::layered[]
|
||||
|
||||
@@ -11,6 +11,6 @@ tasks.getByName<BootJar>("bootJar") {
|
||||
|
||||
// tag::layered[]
|
||||
tasks.getByName<BootJar>("bootJar") {
|
||||
layers()
|
||||
layered()
|
||||
}
|
||||
// end::layered[]
|
||||
|
||||
Reference in New Issue
Block a user