]> source.dussan.org Git - poi.git/commitdiff
try to fix missing modules error and move addOpens detection into ant build
authorAndreas Beeker <kiwiwings@apache.org>
Thu, 24 Jan 2019 20:35:18 +0000 (20:35 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Thu, 24 Jan 2019 20:35:18 +0000 (20:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1852072 13f79535-47bb-0310-9956-ffa450edef68

build.xml
jenkins/create_jobs.groovy

index 6cc0f31b2788efb601faf2712e38f8460bcebacc..a5fd1bb8504230393b5f2ad3dc739d61f7c269ec 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -64,6 +64,17 @@ under the License.
         <contains string="${java.vendor}" substring="IBM" casesensitive="false"/>
     </condition>
 
+    <!-- add addOpens parameter for Java 9 and higher -->
+    <condition property="addOpens">
+        <not><matches pattern="1\..*" string="${java.version}"/></not>
+    </condition>
+
+    <!-- add addOpens parameter for Java 10 -->
+    <condition property="addOpens10">
+        <matches pattern="10\..*" string="${java.version}"/>
+    </condition>
+
+
     <!--
         Logging is suppressed by default.
         To redirect log output to console, run ant with -Dorg.apache.poi.util.POILogger=org.apache.poi.util.SystemOutLogger
@@ -87,6 +98,7 @@ under the License.
     <property name="testpattern" value="Test*"/> <!--note: this excludes BaseTest* -->
     <property name="POI.testdata.path" location="test-data"/>
     <property name="java.awt.headless" value="true"/>
+    <property name="java.locale.providers" value="JRE,CLDR"/>
     <property name="additionaljar" value=""/>
     <propertyreset name="user.language" value="en"/>
     <propertyreset name="user.country" value="US"/>
@@ -1230,14 +1242,15 @@ under the License.
                     <jvmarg value="-ea"/>
 
                     <!-- some "add-opens" and other properties are needed when running with Java 9 or newer -->
-                    <jvmarg value="${java9addmods}" if:set="java9addmods" />
-                    <jvmarg value="${java9addmodsvalue}" if:set="java9addmodsvalue" />
-                    <jvmarg value="${java9addopens1}" if:set="java9addopens1" />
-                    <jvmarg value="${java9addopens2}" if:set="java9addopens2" />
-                    <jvmarg value="${java9addopens3}" if:set="java9addopens3" />
-                    <jvmarg value="${java9addopens4}" if:set="java9addopens4" />
-                    <jvmarg value="${java9addopens5}" if:set="java9addopens5" />
-                    <jvmarg value="${java9addopens6}" if:set="java9addopens6}" />
+                    <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}" />
+                    <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}" />
+                    <jvmarg value="--add-opens=java.base/java.lang=ALL-UNNAMED" if:true="${addOpens}" />
+                    <jvmarg value="--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED" if:true="${addOpens}" />
 
                     <jvmarg value="-javaagent:${ooxml.lite.agent}=${ooxml.lite.report}|${ooxml.lite.includes}" if:true="${ooxml.lite.agent.exists}"/>
 
@@ -1777,7 +1790,7 @@ under the License.
                 <include name="org/apache/poi/**"/>
             </packageset>
             
-            <arg value="${javadoc9addmods}" if:set="${javadoc9addmods}"/>
+            <arg value="--add-modules=java.xml.bind" if:true="${addOpens10}"/>
 
             <doctitle><![CDATA[<h1>POI API Documentation</h1>]]></doctitle>
             <bottom>
index ca1d082d6ba2942297c8fe6a1cfcb98fb52ce890..fc4803e835d7ada00c2a65f5fd6e82ed31f5a148 100644 (file)
@@ -25,57 +25,23 @@ def poijobs = [
           // the JDK is missing on some slaves so builds are unstable
           skipcigame: true
         ],
-        [ name: 'POI-DSL-1.10', jdk: '1.10', trigger: triggerSundays,
-          properties: ['-Djava9addmods=--add-modules=java.xml.bind',
-                       '-Djavadoc9addmods=--add-modules=java.xml.bind',
-                       '-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
-                       '-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
-                       '-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
-                       '-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
-                       '-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
-                       '-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
-                       '-Djava9addopens6=--add-opens=java.base/java.lang=java.xml.bind',
-                       '-Djava.locale.providers=JRE,CLDR'],
-          skipcigame: true
+        [ name: 'POI-DSL-1.10', jdk: '1.10', trigger: triggerSundays, skipcigame: true
         ],
-        [ name: 'POI-DSL-1.11', jdk: '1.11', trigger: triggerSundays,
+        [ name: 'POI-DSL-1.11', jdk: '1.11', trigger: triggerSundays, skipcigame: true,
           // Nodes beam* do not yet have JDK 11 installed
-          slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam6&&!beam7&&!beam8&&!beam9&&!beam10&&!beam11&&!beam12&&!beam13&&!beam14&&!beam15&&!beam16',
-          properties: ['-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
-                       '-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
-                       '-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
-                       '-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
-                       '-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
-                       '-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
-                       '-Djava.locale.providers=JRE,CLDR'],
-          skipcigame: true
+          slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam6&&!beam7&&!beam8&&!beam9&&!beam10&&!beam11&&!beam12&&!beam13&&!beam14&&!beam15&&!beam16'
         ],
-        [ name: 'POI-DSL-1.12', jdk: '1.12', trigger: triggerSundays,
+        [ name: 'POI-DSL-1.12', jdk: '1.12', trigger: triggerSundays, skipcigame: true,
           // Nodes beam* do not yet have JDK 12 installed
-          slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam6&&!beam7&&!beam8&&!beam9&&!beam10&&!beam11&&!beam12&&!beam13&&!beam14&&!beam15&&!beam16',
-          properties: ['-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
-                       '-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
-                       '-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
-                       '-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
-                       '-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
-                       '-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
-                       '-Djava.locale.providers=JRE,CLDR'],
-          skipcigame: true
+          // H43 has outdated JDK12 installed
+          slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam6&&!beam7&&!beam8&&!beam9&&!beam10&&!beam11&&!beam12&&!beam13&&!beam14&&!beam15&&!beam16&&!H43'
         ],
-        [ name: 'POI-DSL-1.13', jdk: '1.13', trigger: triggerSundays,
+        [ name: 'POI-DSL-1.13', jdk: '1.13', trigger: triggerSundays, skipcigame: true,
           // Nodes beam* do not yet have JDK 13 installed
           slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam6&&!beam7&&!beam8&&!beam9&&!beam10&&!beam11&&!beam12&&!beam13&&!beam14&&!beam15&&!beam16',
-          properties: ['-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
-                       '-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
-                       '-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
-                       '-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
-                       '-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
-                       '-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
-                       '-Djava.locale.providers=JRE,CLDR',
-                       // JaCoCo currently fails with "java.lang.NoSuchFieldException: $jacocoAccess",
+          properties: [// JaCoCo currently fails with "java.lang.NoSuchFieldException: $jacocoAccess",
                        // need to review/check with newer JDK 13 builds or when at least JaCoCo 0.8.3
-                       '-Dcoverage.enabled=false'],
-          skipcigame: true
+                       '-Dcoverage.enabled=false']
         ],
         [ name: 'POI-DSL-IBM-JDK', jdk: 'IBMJDK', trigger: triggerSundays, skipcigame: true
         ],
@@ -104,15 +70,7 @@ def poijobs = [
         ],
         [ name: 'POI-DSL-Windows-1.8', trigger: 'H */12 * * *', windows: true, slaves: 'Windows'
         ],
-        [ name: 'POI-DSL-Windows-1.12', jdk: '1.12', trigger: triggerSundays, windows: true, slaves: 'Windows',
-                properties: ['-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
-                       '-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
-                       '-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
-                       '-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
-                       '-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
-                       '-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
-                       '-Djava.locale.providers=JRE,CLDR'],
-                skipcigame: true
+        [ name: 'POI-DSL-Windows-1.12', jdk: '1.12', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true
         ],
         [ name: 'POI-DSL-Github-PullRequests', trigger: '', githubpr: true, skipcigame: true,
           // ensure the file which is needed from the separate documentation module does exist