Each `layerContent` closure defines a strategy to include or exclude an entry of the jar in a layer.
Each `layerContent` closure defines a strategy to include or exclude an entry of the jar in a layer.
When an entry matches a strategy, it is included in the layer and further strategies are ignored.
When an entry matches a strategy, it is included in the layer and further strategies are ignored.
This is illustrated by the `dependencies` and `application` layers that have a "catch-all" include filter used to add any libraries or classes that were not processed by previous strategies.
This is illustrated by the `dependencies` layer that has a "catch-all" include filter used to add any libraries that were not processed by previous strategies.
The content of a `libraries` layer can be customized using filters to `include` or `exclude` based on the dependency coordinates.
The content of a `libraries` layer can be customized using filters to `include` or `exclude` based on the dependency coordinates.
@ -102,11 +102,10 @@ By default, the following layers are created:
* `dependencies` for any dependency whose version does not contain `SNAPSHOT`.
* `dependencies` for any dependency whose version does not contain `SNAPSHOT`.
* `snapshot-dependencies` for any dependency whose version contains `SNAPSHOT`.
* `snapshot-dependencies` for any dependency whose version contains `SNAPSHOT`.
* `resources` for static resources at the default locations, i.e. `META-INF/resources/`, `resources/`, `static/`, `public/`.
* `application` for application classes and resources.
* `application` for any other classes and resources.
The layers order is important as it determines how likely previous layers can be cached when part of the application changes.
The layers order is important as it determines how likely previous layers can be cached when part of the application changes.
The default order is `dependencies`, `snapshot-dependencies`, `resources`, and `application`.
The default order is `dependencies`, `snapshot-dependencies`, and `application`.
Content that is least likely to change should be added first, followed by layers that are more likely to change.
Content that is least likely to change should be added first, followed by layers that are more likely to change.
@ -149,7 +148,6 @@ The following example shows what the implicit layer configuration described abov
<layers>
<layers>
<layer>dependencies</layer>
<layer>dependencies</layer>
<layer>snapshot-dependencies</layer>
<layer>snapshot-dependencies</layer>
<layer>resources</layer>
<layer>application</layer>
<layer>application</layer>
</layers>
</layers>
<libraries>
<libraries>
@ -165,14 +163,6 @@ The following example shows what the implicit layer configuration described abov
</layer-content>
</layer-content>
</libraries>
</libraries>
<application>
<application>
<layer-content layer="resources">
<locations>
<include>META-INF/resources/**</include>
<include>resources/**</include>
<include>static/**</include>
<include>public/**</include>
</locations>
</layer-content>
<layer-content layer="application">
<layer-content layer="application">
<locations>
<locations>
<include>**</include>
<include>**</include>
@ -184,7 +174,7 @@ The following example shows what the implicit layer configuration described abov
Each `layer-content` element defines a strategy to include or exclude an entry of the jar in a layer.
Each `layer-content` element defines a strategy to include or exclude an entry of the jar in a layer.
When an entry matches a strategy, it is included in the layer and further strategies are ignored.
When an entry matches a strategy, it is included in the layer and further strategies are ignored.
This is illustrated by the `dependencies` and `application` layers that have a "catch-all" include filter used to add any libraries or classes that were not processed by previous strategies.
This is illustrated by the `dependencies` layer that has a "catch-all" include filter used to add any libraries that were not processed by previous strategies.
The content of a `libraries` layer can be customized using filters to `include` or `exclude` based on the dependency coordinates.
The content of a `libraries` layer can be customized using filters to `include` or `exclude` based on the dependency coordinates.