From a2364028dc7ae12c1564a3f6194a0f428c3aa69f Mon Sep 17 00:00:00 2001 From: David O'Sullivan Date: Sun, 21 Aug 2022 18:56:17 +0100 Subject: [PATCH] Sets env variable to allow Boot apps to build with GraalVM v22.2 --- native/native_image.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/native/native_image.go b/native/native_image.go index c501b09..9a6a9d8 100644 --- a/native/native_image.go +++ b/native/native_image.go @@ -69,6 +69,12 @@ func (n NativeImage) Contribute(layer libcnb.Layer) (libcnb.Layer, error) { if err != nil { return libcnb.Layer{}, fmt.Errorf("unable to process arguments\n%w", err) } + moduleVar := "USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM" + if _, set := os.LookupEnv(moduleVar); !set{ + if err := os.Setenv(moduleVar, "false"); err != nil{ + n.Logger.Bodyf("unable to set %s for GraalVM 22.2, if your build fails, you may need to set this manually at build time", moduleVar) + } + } buf := &bytes.Buffer{} if err := n.Executor.Execute(effect.Execution{