Executable Spring Boot archives are not supported (Unexpected record signature: 0X622F2123)
Things to check before reporting a bug
- [x] I have searched GraalVM GitHub repository and could not find a similar issue
- [x] I have searched Spring experimental GraalVM Native project and could not find a similar issue
- [x] I have attached a sample project so that the issue can be reproduced on other computers
Describe the bug
build failed with error message above
To Reproduce Add to build.gradle:
bootJar {
launchScript()
}
Expected behavior
buildNativeImage task should build image
The error message means the JAR file generated by bootJar is not a valid/standard zip file. Can you share a simple test repository that I can use to reproduce the error locally?
Just add launchScript() to bootJar configuration of any Spring Boot application and Spring Boot will repackage jar with executable script, see https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#packaging-executable-configuring-launch-script
RIght, on the documentation it says "Currently, some tools do not accept this format so you may not always be able to use this technique" so apparently the JAR file generated is not supported by this plugin which uses Java API to extract the contents from the JAR file.
Why do you want to produce an executable JAR while at the end you want a native image?
@ayltai I just follow guide to enable native image plugin and see this error. If it is too much work to add support for this non-standard jar then guide should mention that option and ask user to remove it
Good point. I wasn't aware of that. Thanks