Fix detecting Java <= 8 vs. >= 9 to not detect Java 8 for version-string "11.x"

Add system property to junit to disable optimization in jaxb which causes illegal access in Java 9+
Add argument to junit to display all illegal accesses in Java 9+

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1854629 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2019-03-02 09:18:15 +00:00
parent 00a274c656
commit 421fffbd3f
1 changed files with 7 additions and 4 deletions

View File

@ -66,12 +66,12 @@ under the License.
<!-- add addOpens parameter for Java 9 and higher -->
<condition property="addOpens">
<not><matches pattern="1\..*" string="${java.version}"/></not>
<not><matches pattern="^1\..*" string="${java.version}"/></not>
</condition>
<!-- add addOpens parameter for Java 10 -->
<condition property="addOpens10">
<matches pattern="10\..*" string="${java.version}"/>
<matches pattern="^10\..*" string="${java.version}"/>
</condition>
@ -1242,11 +1242,14 @@ under the License.
<jvmarg value="-Xmx@{heap}M"/>
<jvmarg value="-ea"/>
<!-- some "add-opens" and other properties are needed when running with Java 9 or newer -->
<!-- some "add-opens" are needed for Java 10, but not for 11+ -->
<jvmarg value="--add-modules=java.xml.bind" if:true="${addOpens10}" />
<jvmarg value="--add-opens=java.base/java.lang=java.xml.bind" if:true="${addOpens10}" />
<jvmarg value="-Dsun.reflect.debugModuleAccessChecks=true" if:true="${addOpens}" />
<!-- some "add-opens" and other properties are needed when running with Java 9 or newer -->
<sysproperty key="sun.reflect.debugModuleAccessChecks" value="true" if:true="${addOpens}" />
<sysproperty key="com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize" value="true" if:true="${addOpens}" />
<jvmarg value="--illegal-access=warn" if:true="${addOpens}" />
<jvmarg value="--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED" if:true="${addOpens}" />
<jvmarg value="--add-opens=java.base/java.io=ALL-UNNAMED" if:true="${addOpens}" />
<jvmarg value="--add-opens=java.base/java.nio=ALL-UNNAMED" if:true="${addOpens}" />