Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sample of how to configure Spring Boot's layered jar support for multi-module build that includes your own libs
subprojects { subproject ->
// ...
plugins.withId('org.springframework.boot') {
springBoot {
bootJar {
layered {
// application follows Boot's defaults
application {
intoLayer("spring-boot-loader") {
include "org/springframework/boot/loader/**"
// for dependencies we ensure that our own libraries are put into a separate layer
dependencies {
intoLayer("libs-dependencies") {
include "nl.trifork:*:*"
layerOrder = ["dependencies", "spring-boot-loader", "libs-dependencies", "application"]
buildInfo {
properties {
// ensure builds result in the same artifact when nothing's changed:
time = null
Copy link

JWThewes commented Jun 24, 2020

Do you have any idea if this is possible with maven?

Copy link

jkuipers commented Jun 24, 2020

The Maven plugin provides the same features, but using an external XML config file instead of internal DSL:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment