Skip to content

Commit fc1a8bd

Browse files
4.x: Native image update (helidon-io#7711)
* Native image update - Java 21 - latest version - replace artifact id - remove initialize-at-build-time in SE - doc fix - Updates to graalvm github action - Upgrade jar plugin to honor main class attribute for modules - Add main class to modularized test - Add kotlin dependency to resolve modularized failure - Native packaging test fixed. - Fix archetypes to work with new jar plugin - Kafka connector native image updates --------- Co-authored-by: Daniel Kec <daniel.kec@oracle.com>
1 parent 193297e commit fc1a8bd

118 files changed

Lines changed: 1503 additions & 1106 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/validate.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,22 +140,25 @@ jobs:
140140
- name: Test archetypes
141141
run: etc/scripts/test-archetypes.sh
142142
packaging:
143-
timeout-minutes: 30
143+
timeout-minutes: 60
144144
strategy:
145145
matrix:
146146
os: [ ubuntu-20.04, macos-latest]
147147
runs-on: ${{ matrix.os }}
148148
steps:
149149
- uses: actions/checkout@v3
150-
- name: Set up JDK ${{ env.JAVA_VERSION }}
151-
uses: actions/setup-java@v3.13.0
150+
- uses: graalvm/setup-graalvm@v1
152151
with:
153-
distribution: ${{ env.JAVA_DISTRO }}
154-
java-version: ${{ env.JAVA_VERSION }}
152+
java-version: 21
153+
distribution: graalvm-community
154+
github-token: ${{ secrets.GITHUB_TOKEN }}
155+
native-image-job-reports: true
155156
cache: maven
156157
- name: Build Helidon
157158
run: etc/scripts/github-compile.sh
158159
- name: JAR packaging
159160
run: etc/scripts/test-packaging-jar.sh
160161
- name: JLink packaging
161162
run: etc/scripts/test-packaging-jlink.sh
163+
- name: Native-Image packaging
164+
run: etc/scripts/test-packaging-native.sh

applications/parent/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
<version.plugin.failsafe>3.1.2</version.plugin.failsafe>
4545
<version.plugin.helidon>4.0.0-M2</version.plugin.helidon>
4646
<version.plugin.helidon-cli>4.0.0-M2</version.plugin.helidon-cli>
47-
<version.plugin.jar>3.0.2</version.plugin.jar>
48-
<version.plugin.nativeimage>0.9.16</version.plugin.nativeimage>
47+
<version.plugin.jar>3.3.0</version.plugin.jar>
48+
<version.plugin.nativeimage>0.9.27</version.plugin.nativeimage>
4949
<version.plugin.os>1.5.0.Final</version.plugin.os>
5050
<version.plugin.protobuf>0.6.1</version.plugin.protobuf>
5151
<version.plugin.resources>3.3.1</version.plugin.resources>

archetypes/helidon/src/main/archetype/common/files/Dockerfile.native.mustache

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11

22
# 1st stage, build the app
3-
FROM ghcr.io/graalvm/graalvm-ce:ol9-java21-22.3.1 as build
4-
5-
# Install native-image
6-
RUN gu install native-image
3+
FROM ghcr.io/graalvm/graalvm-community:21.0.0-ol9 as build
74

85
WORKDIR /usr/share
96

archetypes/helidon/src/main/archetype/mp/common/common-mp.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<source src="/common/sources.xml"/>
2626
<output>
2727
<model>
28+
<value key="mainClass">${package}.Main</value>
2829
<value key="parent-artifactId">helidon-mp</value>
2930
<list key="dependencies">
3031
<map>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
package {{package}};
3+
4+
/**
5+
* Main entry point of the application.
6+
* This class is registered as the main class in the jar manifest, as well as the main class of the module.
7+
*/
8+
public class Main {
9+
/**
10+
* Main method. Starts CDI (and the application).
11+
*
12+
* @param args ignored
13+
*/
14+
public static void main(String[] args) {
15+
io.helidon.Main.main(args);
16+
}
17+
}

archetypes/helidon/src/main/archetype/mp/custom/custom-mp.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@
8282
<value>jakarta.cdi</value>
8383
<value>jakarta.inject</value>
8484
<value>jakarta.ws.rs</value>
85+
<value>io.helidon</value>
8586
<value>io.helidon.microprofile.config</value>
87+
<value>io.helidon.microprofile.server</value>
8688
</list>
8789
</model>
8890
</output>

common/common/src/main/resources/META-INF/native-image/io.helidon.common/helidon-common/native-image.properties

Lines changed: 0 additions & 18 deletions
This file was deleted.

common/media-type/src/main/resources/META-INF/native-image/io.helidon.common/helidon-common-media-type/native-image.properties

Lines changed: 0 additions & 19 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"resources": [
3+
{
4+
"pattern": "META-INF/helidon/media-types.properties"
5+
},
6+
{
7+
"pattern": "io/helidon/common/media/type/default-media-types.properties"
8+
}
9+
]
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"resources": [
3+
{
4+
"pattern": "mp-meta-config.yaml"
5+
},
6+
{
7+
"pattern": "mp-meta-config.properties"
8+
}
9+
]
10+
}

0 commit comments

Comments
 (0)