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

Add support for new Boot Loader in Spring Boot 3.2.0 #177

Closed
hjellek opened this issue Jan 11, 2024 · 5 comments
Closed

Add support for new Boot Loader in Spring Boot 3.2.0 #177

hjellek opened this issue Jan 11, 2024 · 5 comments

Comments

@hjellek
Copy link
Contributor

hjellek commented Jan 11, 2024

In Spring Boot 3.2.0 a new org.springframework.boot.loader.launch.JarLauncher has been introduced.

Currently the old loader is hardcoded in write_manifest.sh and springboot_pkg.sh.

This should be open for overriding, or automatically switch between the loaders based on detected Spring Boot version.

As a workaround, one can include spring-boot-loader-classic in the application dependencies to get the old JarLauncher.

@plaird plaird added this to To do in 2.x.x Minor Features and Fixes via automation Jan 11, 2024
@plaird
Copy link
Contributor

plaird commented Jan 11, 2024

Good suggestion, thanks! Should be pretty easy to add.

@plaird
Copy link
Contributor

plaird commented Jan 17, 2024

🔔 we just hit a limitation of this new feature internally. Coincidentally, we had a work item to migrate a Spring Boot app from Maven to Bazel, and we just started doing it and found it happens to need this boot-launcher-class feature.

BUT, the app has written a custom launcher, not one of the ones from Spring Boot. This surfaced an issue. This feature assumes that the launcher class is written into the root of the springboot jar, not in BOOT-INF/lib.

tar -tvf myspringboot.jar
...
com/salesforce/boot/MyCustomJarLauncher.class
...

We will work on a solution to support custom launchers in #129

@luangong
Copy link

I’m using Spring Boot 3 and I also ran into this issue. Hope it could be fixed soon in #129. Thanks!

@plaird
Copy link
Contributor

plaird commented Jan 30, 2024

@luangong release 2.3.1 should have the fix you need. You will need to set the new boot_launcher_class attribute.

   # use the spring boot 3 launcher
   boot_launcher_class = 'org.springframework.boot.loader.launch.JarLauncher',

@luangong
Copy link

Specifying the new JarLauncher via the boot_launcher_class attribute works. Thanks!

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

No branches or pull requests

3 participants