Skip to content

Commit

Permalink
Proper way to pass multiple arguments to Maven plugin for GraalVM Nat…
Browse files Browse the repository at this point in the history
…ive Image
  • Loading branch information
mthmulders committed Feb 21, 2025
1 parent d90afe9 commit 5eb15b3
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

<artifactsDir>target/distributions</artifactsDir>
<executable-suffix></executable-suffix>
<native-image-arguments></native-image-arguments>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -383,7 +382,6 @@
<configuration>
<agentResourceDirectory>${project.basedir}/src/main/graalvm-native</agentResourceDirectory>
<imageName>${project.artifactId}-${project.version}</imageName>
<buildArgs>${native-image-arguments}</buildArgs>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -425,9 +423,21 @@
<family>linux</family>
</os>
</activation>
<properties>
<native-image-arguments>--static -march=compatibility --libc=musl</native-image-arguments>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration combine.self="append">
<buildArgs>
<buildArg>--static</buildArg>
<buildArg>-march=compatibility</buildArg>
<buildArg>--libc=musl</buildArg>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>dist-windows</id>
Expand All @@ -437,6 +447,7 @@
</os>
</activation>
<properties>
<!-- not used in POM, but used in assembly descriptors -->
<executable-suffix>.exe</executable-suffix>
</properties>
</profile>
Expand Down

0 comments on commit 5eb15b3

Please sign in to comment.