Remove deprecated GraalVM native-image flags (#9118)

Motivation:

The first final version of GraalVM was released which deprecated some flags. We should use the new ones.

Modifications:

Removes the use of deprecated GraalVM native-image flags
Adds a flag to initialize netty at build time.

Result:

Do not use deprecated flags
This commit is contained in:
Vojin Jovanovic 2019-05-22 19:20:54 +02:00 committed by Norman Maurer
parent 224d5fafaf
commit 3eff1dbc1b
5 changed files with 15 additions and 11 deletions

View File

@ -12,4 +12,5 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
Args = --delay-class-initialization-to-runtime=io.netty.handler.codec.http.HttpObjectEncoder,io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder Args = --initialize-at-build-time=io.netty \
--initialize-at-run-time=io.netty.handler.codec.http.HttpObjectEncoder,io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder

View File

@ -12,5 +12,5 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
Args = --rerun-class-initialization-at-runtime=io.netty.handler.codec.http2.Http2CodecUtil \ Args = --initialize-at-build-time=io.netty \
--delay-class-initialization-to-runtime=io.netty.handler.codec.http2.DefaultHttp2FrameWriter --initialize-at-run-time=io.netty.handler.codec.http2.Http2CodecUtil,io.netty.handler.codec.http2.DefaultHttp2FrameWriter

View File

@ -25,3 +25,6 @@ RUN curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | JABBA_COMMA
RUN echo 'export JAVA_HOME="/jdk"' >> ~/.bashrc RUN echo 'export JAVA_HOME="/jdk"' >> ~/.bashrc
RUN echo 'PATH=/jdk/bin:$PATH' >> ~/.bashrc RUN echo 'PATH=/jdk/bin:$PATH' >> ~/.bashrc
# when the JDK is GraalVM install native-image
RUN if [ -O /jdk/bin/gu ]; then /jdk/bin/gu install native-image; else echo "Not GraalVM, skip installation of native-image" ; fi

View File

@ -7,7 +7,7 @@ services:
build: build:
args: args:
centos_version : "6" centos_version : "6"
java_version : "graalvm@1.0.0-16" java_version : "graalvm@19.0.0"
test: test:
image: netty:centos-6-1.8 image: netty:centos-6-1.8

14
pom.xml
View File

@ -74,7 +74,7 @@
<activation> <activation>
<file> <file>
<!-- GraalVM Component Updater should exists when using GraalVM--> <!-- GraalVM Component Updater should exists when using GraalVM-->
<exists>${java.home}/bin/native-image</exists> <exists>${java.home}/bin/gu</exists>
</file> </file>
</activation> </activation>
<properties> <properties>
@ -181,7 +181,7 @@
<argLine.java9>--illegal-access=deny --add-modules java.xml.bind ${argLine.java9.extras}</argLine.java9> <argLine.java9>--illegal-access=deny --add-modules java.xml.bind ${argLine.java9.extras}</argLine.java9>
<!-- Not use alpn agent as Java9 supports alpn out of the box --> <!-- Not use alpn agent as Java9 supports alpn out of the box -->
<argLine.alpnAgent /> <argLine.alpnAgent />
<!-- Skip as maven plugin not works with Java9 yet --> <!-- Skip as maven plugin not works with Java9 yet -->
<forbiddenapis.skip>true</forbiddenapis.skip> <forbiddenapis.skip>true</forbiddenapis.skip>
<!-- Needed because of https://issues.apache.org/jira/browse/MENFORCER-275 --> <!-- Needed because of https://issues.apache.org/jira/browse/MENFORCER-275 -->
<enforcer.plugin.version>3.0.0-M1</enforcer.plugin.version> <enforcer.plugin.version>3.0.0-M1</enforcer.plugin.version>
@ -315,7 +315,7 @@
<skipAutobahnTestsuite>false</skipAutobahnTestsuite> <skipAutobahnTestsuite>false</skipAutobahnTestsuite>
<skipHttp2Testsuite>false</skipHttp2Testsuite> <skipHttp2Testsuite>false</skipHttp2Testsuite>
<skipJapicmp>false</skipJapicmp> <skipJapicmp>false</skipJapicmp>
<graalvm.version>1.0.0-rc15</graalvm.version> <graalvm.version>19.0.0</graalvm.version>
<!-- By default skip native testsuite as it requires a custom environment with graalvm installed --> <!-- By default skip native testsuite as it requires a custom environment with graalvm installed -->
<skipNativeImageTestsuite>true</skipNativeImageTestsuite> <skipNativeImageTestsuite>true</skipNativeImageTestsuite>
</properties> </properties>
@ -453,7 +453,7 @@
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<!-- <!--
Completely optional and only needed for OCSP stapling to construct and Completely optional and only needed for OCSP stapling to construct and
parse OCSP requests and responses. parse OCSP requests and responses.
--> -->
@ -814,8 +814,8 @@
<ignore>java.nio.channels.SocketChannel</ignore> <ignore>java.nio.channels.SocketChannel</ignore>
<ignore>java.net.StandardProtocolFamily</ignore> <ignore>java.net.StandardProtocolFamily</ignore>
<ignore>java.nio.channels.spi.SelectorProvider</ignore> <ignore>java.nio.channels.spi.SelectorProvider</ignore>
<ignore>java.net.SocketOption</ignore> <ignore>java.net.SocketOption</ignore>
<ignore>java.net.StandardSocketOptions</ignore> <ignore>java.net.StandardSocketOptions</ignore>
<ignore>java.nio.channels.NetworkChannel</ignore> <ignore>java.nio.channels.NetworkChannel</ignore>
<!-- Self-signed certificate generation --> <!-- Self-signed certificate generation -->
@ -990,7 +990,7 @@
</property> </property>
</properties> </properties>
<jvm>${testJvm}</jvm> <jvm>${testJvm}</jvm>
<!-- Ensure the whole stacktrace is preserved when an exception is thrown. See https://issues.apache.org/jira/browse/SUREFIRE-1457 --> <!-- Ensure the whole stacktrace is preserved when an exception is thrown. See https://issues.apache.org/jira/browse/SUREFIRE-1457 -->
<trimStackTrace>false</trimStackTrace> <trimStackTrace>false</trimStackTrace>
</configuration> </configuration>
</plugin> </plugin>