-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Description
(edit)
Splitting into sub-tasks:
- Provide GraalVM metadata repository files in Spring Boot jar built with Gradle #32408
- Provide maven configuration for native-build-tools reachability metadata goal #32736
- When the GraalVM Native Image Gradle plugin is applied, configure bootJar to contain the output of collectReachabilityMetadata #32737
- Generate native-image argfile containing reachability metadata excludes for buildpacks to use #32738
External issues:
- Include buildtool support for bundling reachability metadata into jar files graalvm/native-build-tools#322
- Allow --exclude-config arguments to be specified inside jar paketo-buildpacks/native-image#196 & Added support for argument file provided... paketo-buildpacks/native-image#201
As discussed with @dmikusa-pivotal, @mhalbritter and @scottfrederick, we need to integrate GraalVM metadata repository in Buildpacks in addition to Native Build Tools current support (see #31687) in order to allow compiling Spring Boot application with third-party dependencies to a native executable. 2 implementations have been discussed.
Based on our discussions, integration at Spring Boot Maven and Gradle plugin AOT generation level is the recommended way to implement such integration because:
- It allows a single and consistent way to provide third-party native configuration for Spring Boot applications
- It can leverage graalvm-reachability-metadata Java library and its
GraalVMReachabilityMetadataRepository
class maintained by GraalVM team. - Reference implementation in NBT Gradle and Maven plugins can help us for the Spring Boot implementation.
- Conceptually a good fit to put third party hints along to Spring ones
- Better DevXP (all the JSON hints generated at the same location at the same time)
- Better build reproducibility
- Gives more control to Spring Boot on the reachability metadata repository release a certain version of Spring Boot uses
The alternative way is to have 2 distinct implementations : the one at NBT plugins level and another at Buildpacks level, but the lack of consistency, poorer DevXP, the fact that we would likely have to reimplement graalvm-reachability-metadata
in Go and maintaining it seems to indicate this should not be the way to move forward.