As the layered jars feature (incl. layers.idx
file generation and spring-boot-maven-plugin support for Cloud Native Buildpacks / Paketo.io) was introduced in Spring Boot 2.3 I would say that you can't really downgrade it with the standard tooling.
BUT I guess you could try to generate the layers.idx
file yourself - or even choose a default file, since the layout of your app may not change that much after all. A example would be (using no SNAPSHOT
depencencies):
- "dependencies":
- "BOOT-INF/lib/"
- "spring-boot-loader":
- "org/"
- "snapshot-dependencies":
- "application":
- "BOOT-INF/classes/"
- "BOOT-INF/classpath.idx"
- "BOOT-INF/layers.idx"
- "META-INF/"
Having this file in place (means place it into your target
folder (maybe you could automate that with a simple Maven plugin for example)), pack CLI should be able to pick it up. So install pack CLI and run a Paketo build without using the spring-boot-maven-plugin
yourself like this:
pack build yourAppNameHere --path . --builder paketobuildpacks/builder:base
I didn't really tried this approach myself - and maybe you run into problems, if the directory structure is much different in older Spring Boot versions. But I would appreciate to hear some feedback!