Fail build when Illegal reflective access is detected (#8933)

Motivation:

We want to make the experience as smooth as possible for our users when using Java9+ and so should ensure we do not produce any 'Illegal reflective access' errors when using netty.

Modifications:

Add jvmArgs when running our tests that will deny reflective access and so will fail the build at the end due not be able to load some classes.

Result:

Ensure we do not produce any illegal refelctive access errors when using java9+
This commit is contained in:
Norman Maurer 2019-03-13 09:47:02 +01:00
parent 42742e233f
commit 047cae8edc
1 changed files with 10 additions and 1 deletions

11
pom.xml
View File

@ -94,6 +94,9 @@
<jdk>12</jdk>
</activation>
<properties>
<argLine.java9.extras />
<!-- Export some stuff which is used during our tests -->
<argLine.java9>--illegal-access=deny ${argLine.java9.extras}</argLine.java9>
<!-- Not use alpn agent as Java11 supports alpn out of the box -->
<argLine.alpnAgent />
<forbiddenapis.skip>true</forbiddenapis.skip>
@ -113,6 +116,9 @@
<jdk>11</jdk>
</activation>
<properties>
<argLine.java9.extras />
<!-- Export some stuff which is used during our tests -->
<argLine.java9>--illegal-access=deny ${argLine.java9.extras}</argLine.java9>
<!-- Not use alpn agent as Java11 supports alpn out of the box -->
<argLine.alpnAgent />
<forbiddenapis.skip>true</forbiddenapis.skip>
@ -132,6 +138,9 @@
<jdk>10</jdk>
</activation>
<properties>
<argLine.java9.extras />
<!-- Export some stuff which is used during our tests -->
<argLine.java9>--illegal-access=deny --add-modules java.xml.bind ${argLine.java9.extras}</argLine.java9>
<!-- Not use alpn agent as Java10 supports alpn out of the box -->
<argLine.alpnAgent />
<forbiddenapis.skip>true</forbiddenapis.skip>
@ -148,7 +157,7 @@
<properties>
<argLine.java9.extras />
<!-- Export some stuff which is used during our tests -->
<argLine.java9>--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 -->
<argLine.alpnAgent />
<!-- Skip as maven plugin not works with Java9 yet -->