Repository navigation
Add native image guide: build, run, and configure the executable - #11
Merged
Merged
Conversation
docs/native-image.md covers prerequisites, building, build memory tuning, running the executable, configuring it at runtime (arguments, environment, config files, -Xmx), settings that AOT fixes at build time and how to set them (spring-boot.aot.jvmArguments), and troubleshooting. Linked from the README. Checked against the native build of main: --server.port, SERVER_PORT, ./config/application.properties and -Xmx work at runtime; --springdoc.api-docs.enabled=false is ignored at runtime (it works on the JVM), and passing it via spring-boot.aot.jvmArguments removes the springdoc beans from the AOT output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012MLyPXGHeCc1fvTeB8JnT2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
docs/native-image.md, linked from the README's native image section. It covers:./mvnw -Pnative -DskipTests native:compile, what happens and what it produces, and build memory tuning (-J-Xmx,--parallelism,-Ob)../target/resourceapi: no JVM needed, graceful shutdown.config/application.properties, and-Xmx.-Dspring-boot.aot.jvmArguments=....Verified against the native build of
main--server.port=9090,SERVER_PORT=9091,./config/application.properties(port 9092) and-Xmx64mall work.--springdoc.api-docs.enabled=false --springdoc.swagger-ui.enabled=falsehas no effect in the native executable (both still answer 200), while the same flags give 404 onjava -jar.-Dspring-boot.aot.jvmArgumentsremoves the springdoc beans from the AOT output (generated sources mentioning springdoc go from 11 to 2). I checked the AOT step only, not a full native build with them.Generated by Claude Code