1

With Spring Boot 3.0 RC1 spring team decided to moved all of the graalvm native-maven-plugin configuration to spring-boot-parent...and we simply inherit the native profile. I like this move but we have lost the possibility of passing the native image build arguments... buildArgs.

Is there any possibility to pass native image build arguments to native-maven-plugin with Spring Boot 3.0 RC1 except of complete overriding of "native-maven-plugin" definition in the child pom.xml?

I mean buildArgs:

<configuration>
         <imageName>${binary-name}</imageName>
         <skip>${skip-native-build}</skip>
         <buildArgs>
             <buildArg>-H:+ReportExceptionStackTraces ${native-image-extra-flags}. </buildArg>
         </buildArgs>
     </configuration>

thanks.

Tomas Kloucek
  • 251
  • 2
  • 12

2 Answers2

1

For anybody interested. There are two options. Override of graalvm build plugin with wanted build params. Check this out.

https://graalvm.github.io/native-build-tools/latest/maven-plugin.html#configuration-reusing-config-from-parent

or calling to native-image build tool.

Tomas Kloucek
  • 251
  • 2
  • 12
0

You can use this plugin, but it still has bugs in springboot 3.0 RC version

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
            <jvmArguments>--enable-preview</jvmArguments>
            <compilerArguments>--enable-preview</compilerArguments>
        </configuration>
</plugin>
Idan Str
  • 614
  • 1
  • 11
  • 33
Tyler
  • 1