Skip to content

4.x: backport native-image fixes + support -Dnative.image.skip and -Dnative.image.buildStatic #7972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions applications/mp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@
<goals>
<goal>generateResourceConfig</goal>
</goals>
<phase>package</phase>
</execution>
<execution>
<id>build-native-image</id>
<goals>
<goal>compile</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
Expand Down
54 changes: 54 additions & 0 deletions applications/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,15 @@
<executions>
<execution>
<id>resource-config</id>
<phase>package</phase>
<configuration>
<!-- generate records for all module's resources -->
<isDetectionEnabled>true</isDetectionEnabled>
</configuration>
</execution>
<execution>
<id>build-native-image</id>
<phase>package</phase>
<configuration>
<!-- generate an argument file for native image - great for troubleshooting -->
<useArgFile>true</useArgFile>
Expand All @@ -214,6 +216,58 @@
</pluginManagement>
</build>
<profiles>
<profile>
<id>native-image-skip</id>
<activation>
<property>
<name>native.image.skip</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<executions>
<execution>
<id>resource-config</id>
<phase>none</phase>
</execution>
<execution>
<id>build-native-image</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>native-image-static</id>
<activation>
<property>
<name>native.image.buildStatic</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<executions>
<execution>
<id>build-native-image</id>
<configuration>
<buildArgs combine.children="append">
<arg>--static</arg>
</buildArgs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>helidon-cli</id>
<activation>
Expand Down
2 changes: 0 additions & 2 deletions applications/se/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,12 @@
<goals>
<goal>generateResourceConfig</goal>
</goals>
<phase>package</phase>
</execution>
<execution>
<id>build-native-image</id>
<goals>
<goal>compile</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ WORKDIR /helidon
# Incremental docker builds will always resume after that, unless you update
# the pom
ADD pom.xml .
RUN mvn clean package -Pnative-image -Dnative.image.skip -Dmaven.test.skip -Declipselink.weave.skip
RUN mvn package -Pnative-image -Dnative.image.skip -Dmaven.test.skip -Declipselink.weave.skip

# Do the Maven build!
# Incremental docker builds will resume here when you change sources
Expand Down