Skip to content

Commit

Permalink
Sets env variable to allow Boot apps to build with GraalVM v22.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pivotal-david-osullivan committed Aug 21, 2022
1 parent 30b9723 commit a236402
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions native/native_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit a236402

Please sign in to comment.