Skip to content

Commit

Permalink
4.x: Native image update (helidon-io#7711)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
2 people authored and dalexandrov committed Oct 17, 2023
1 parent 93cfc36 commit 8c56894
Show file tree
Hide file tree
Showing 118 changed files with 1,503 additions and 1,106 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,25 @@ jobs:
- name: Test archetypes
run: etc/scripts/test-archetypes.sh
packaging:
timeout-minutes: 30
timeout-minutes: 60
strategy:
matrix:
os: [ ubuntu-20.04, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/[email protected]
- uses: graalvm/setup-graalvm@v1
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
java-version: 21
distribution: graalvm-community
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: true
cache: maven
- name: Build Helidon
run: etc/scripts/github-compile.sh
- name: JAR packaging
run: etc/scripts/test-packaging-jar.sh
- name: JLink packaging
run: etc/scripts/test-packaging-jlink.sh
- name: Native-Image packaging
run: etc/scripts/test-packaging-native.sh
4 changes: 2 additions & 2 deletions applications/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
<version.plugin.failsafe>3.1.2</version.plugin.failsafe>
<version.plugin.helidon>4.0.0-M2</version.plugin.helidon>
<version.plugin.helidon-cli>4.0.0-M2</version.plugin.helidon-cli>
<version.plugin.jar>3.0.2</version.plugin.jar>
<version.plugin.nativeimage>0.9.16</version.plugin.nativeimage>
<version.plugin.jar>3.3.0</version.plugin.jar>
<version.plugin.nativeimage>0.9.27</version.plugin.nativeimage>
<version.plugin.os>1.5.0.Final</version.plugin.os>
<version.plugin.protobuf>0.6.1</version.plugin.protobuf>
<version.plugin.resources>3.3.1</version.plugin.resources>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

# 1st stage, build the app
FROM ghcr.io/graalvm/graalvm-ce:ol9-java21-22.3.1 as build

# Install native-image
RUN gu install native-image
FROM ghcr.io/graalvm/graalvm-community:21.0.0-ol9 as build

WORKDIR /usr/share

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<source src="/common/sources.xml"/>
<output>
<model>
<value key="mainClass">${package}.Main</value>
<value key="parent-artifactId">helidon-mp</value>
<list key="dependencies">
<map>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

package {{package}};

/**
* Main entry point of the application.
* This class is registered as the main class in the jar manifest, as well as the main class of the module.
*/
public class Main {
/**
* Main method. Starts CDI (and the application).
*
* @param args ignored
*/
public static void main(String[] args) {
io.helidon.Main.main(args);
}
}
2 changes: 2 additions & 0 deletions archetypes/helidon/src/main/archetype/mp/custom/custom-mp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
<value>jakarta.cdi</value>
<value>jakarta.inject</value>
<value>jakarta.ws.rs</value>
<value>io.helidon</value>
<value>io.helidon.microprofile.config</value>
<value>io.helidon.microprofile.server</value>
</list>
</model>
</output>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"resources": [
{
"pattern": "META-INF/helidon/media-types.properties"
},
{
"pattern": "io/helidon/common/media/type/default-media-types.properties"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"resources": [
{
"pattern": "mp-meta-config.yaml"
},
{
"pattern": "mp-meta-config.properties"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,51 @@
{
"pattern": "application.properties"
},
{
"pattern": "application.yaml"
},
{
"pattern": "application.json"
},
{
"pattern": "application.conf"
},
{
"pattern": "application.yml"
},
{
"pattern": "meta-config.properties"
},
{
"pattern": "meta-config.json"
},
{
"pattern": "meta-config.yaml"
},
{
"pattern": "meta-config.yml"
},
{
"pattern": "meta-config.conf"
},
{
"pattern": "config-profile.yaml"
},

{
"pattern": "config-profile.properties"
},

{
"pattern": "config-profile.json"
},

{
"pattern": "config-profile.conf"
},

{
"pattern": "config-profile.yml"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020 Oracle and/or its affiliates.
# Copyright (c) 2020, 2023 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,4 +14,4 @@
# limitations under the License.
#

Args=--initialize-at-build-time=org.slf4j -H:EnableURLProtocols=https
Args=--enable-https

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
},
{
"pattern": "config-profile-.*\\.yaml$"
},
{
"pattern": "application.yml"
},
{
"pattern": "meta-config.yml"
},
{
"pattern": "config-profile.yml"
},
{
"pattern": "config-profile-.*\\.yml$"
}
]
}

This file was deleted.

22 changes: 10 additions & 12 deletions dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<version.lib.google-oauth-client>1.33.3</version.lib.google-oauth-client>
<version.lib.google-error-prone>2.3.3</version.lib.google-error-prone>
<version.lib.google-protobuf>3.21.7</version.lib.google-protobuf>
<version.lib.graalvm>22.3.0</version.lib.graalvm>
<version.lib.graalvm>23.1.0</version.lib.graalvm>
<version.lib.graphql-java>18.6</version.lib.graphql-java>
<version.lib.graphql-java.extended.scalars>18.3</version.lib.graphql-java.extended.scalars>
<version.lib.gson>2.9.0</version.lib.gson>
Expand Down Expand Up @@ -94,7 +94,8 @@
<version.lib.jersey>3.1.3</version.lib.jersey>
<version.lib.jgit>6.7.0.202309050840-r</version.lib.jgit>
<version.lib.junit>5.9.3</version.lib.junit>
<version.lib.kafka>3.4.0</version.lib.kafka>
<version.lib.kafka>3.5.1</version.lib.kafka>
<version.lib.kotlin>1.8.0</version.lib.kotlin>
<version.lib.log4j>2.18.0</version.lib.log4j>
<version.lib.logback>1.4.0</version.lib.logback>
<version.lib.mariadb-java-client>2.6.2</version.lib.mariadb-java-client>
Expand Down Expand Up @@ -915,7 +916,7 @@
</dependency>
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<artifactId>nativeimage</artifactId>
<version>${version.lib.graalvm}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -943,15 +944,12 @@
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>${version.lib.kafka}</version>
<!-- Snip transitive dependency on Snappy (which should be optional anyways). -->
<!-- This can be removed once kafka-clients is upgraded -->
<!-- to 3.4.2 or newer. See https://issues.apache.org/jira/browse/KAFKA-15096 -->
<exclusions>
<exclusion>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<!-- required transitively by okhttp (used in OpenTelemetry through Jaeger) -->
<artifactId>kotlin-stdlib</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${version.lib.kotlin}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
Expand Down
Loading

0 comments on commit 8c56894

Please sign in to comment.