Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for thin executable jars #117

Open
dsyer opened this issue Sep 28, 2021 · 2 comments
Open

Support for thin executable jars #117

dsyer opened this issue Sep 28, 2021 · 2 comments
Labels
type:enhancement A general enhancement

Comments

@dsyer
Copy link

dsyer commented Sep 28, 2021

If you try to build an image with a Spring Boot Thin Launcher target (thin not fat jar) the Spring Boot BP barfs because it can't find a bill of materials:

[INFO]     [creator]     Paketo Executable JAR Buildpack 5.3.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/executable-jar
[INFO]     [creator]       Class Path: Contributing to layer
[INFO]     [creator]         Writing env/CLASSPATH.delim
[INFO]     [creator]         Writing env/CLASSPATH.prepend
[INFO]     [creator]       Process types:
[INFO]     [creator]         executable-jar: java org.springframework.boot.loader.wrapper.ThinJarWrapper (direct)
[INFO]     [creator]         task:           java org.springframework.boot.loader.wrapper.ThinJarWrapper (direct)
[INFO]     [creator]         web:            java org.springframework.boot.loader.wrapper.ThinJarWrapper (direct)
[INFO]     [creator]     
[INFO]     [creator]     Paketo Spring Boot Buildpack 4.6.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/spring-boot
[INFO]     [creator]     
[INFO]     [creator]     Paketo Spring Boot Buildpack 4.6.0
[INFO]     [creator]       manifest does not container Spring-Boot-Lib
[INFO]     [creator]     ERROR: failed to build: exit status 1

I think for compatibility with other bp configuration you’d really want to download all the deps at image build time and include them in the BOM. This would bring us into line with the CF buildpacks as well (which already support thin jars via an additional step during droplet creation).

To download the deps (to ~/.m2/repository by default) and print the classpath you can just run the jar with --thin.classpath. Other options are available (e.g. properties file format). See docs here: https://github.com/spring-projects-experimental/spring-boot-thin-launcher

@dmikusa dmikusa added the type:enhancement A general enhancement label Sep 28, 2021
@johnnyr0x
Copy link

@dsyer is this still worth doing?

@dsyer
Copy link
Author

dsyer commented Sep 1, 2022

I think so. It’s not hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants