Native Image Test - #179
Open
crazyrokr wants to merge 3 commits into
Open
Conversation
…eflectionForBinding
crazyrokr
force-pushed
the
feature/native-image-without-reachability-metadata
branch
from
June 22, 2026 00:13
08729d9 to
feefd3e
Compare
crazyrokr
force-pushed
the
feature/native-image-without-reachability-metadata
branch
from
June 22, 2026 00:46
0bd6a9e to
e024e83
Compare
crazyrokr
marked this pull request as ready for review
June 22, 2026 00:46
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
Removes the javaagent-generated
reachability-metadata.jsonfrom the GraalVM native build and replaces its coverage with declarative Spring AOT hints, library-supplied metadata, build flags, and a reflection-free enum lookup — so the native image ships with no project-maintainedreachability-metadata.jsonand noRuntimeHintsRegistrar. Also adds an automated test that boots the native binary and runs the existing MQTT integration specs against it.Changes
Array/ArrayFactorycollections create typed arrays viaArray.newInstance, so each component's array class must still be registered.NativeReflectionHintsConfig(a@Configurationimported byMqttBrokerApplication) declares these via@RegisterReflectionForBinding— an AOT-processed annotation, not a JSON file orRuntimeHintsRegistrar. (ExpirableSession/NotExpirableSessionwere madepublicso their array classes are referenceable.)metadataRepository { enabled = true }) for libraries that don't ship their own metadata (Jackson, Logback, PostgreSQL-JDBC, SnakeYAML; Flyway 11.19.0 via the repo's latest-config fallback), and--enable-all-security-servicesfor the JCE/TLS providers that were the 51com.sun.crypto.providerentries. The GraalVM vendor match was broadened fromGraalVM CommunitytoGraalVM(matches CE and Oracle).NativeImageVerificationTestlaunches the compiled native binary, waits for theStarted external MQTT networkmarker, and re-runs the application's integration specs against it via JUnit Platform TestKit (EmbeddedSpecRunner). Wired as thenativeImageTesttask, withcopyNativeImageTestResourcesstaging test config/credentials/ACL next to the binary. Supporting changes:applicationexposes its test fixtures (testFixturesImplementation) andjunit-platform-testkitwas added.Notes
--enable-all-security-servicesis deprecated by GraalVM but functional; a follow-up can migrate to its successor.metadataRepository { moduleToConfigVersion = ['org.flywaydb:flyway-core': '11.14.1'] }.