Pass appropriate MAVEN_OPTS for JDK 11+

They are required by spotless starting JDK 16+
This commit is contained in:
Guillaume Smet
2021-03-19 15:43:11 +01:00
parent 34a1f9d6e4
commit ea3cbd4c71

View File

@@ -2,6 +2,9 @@ name: CI
on: [push, pull_request]
# this is required by spotless for JDK 16+
env:
JAVA_11_PLUS_MAVEN_OPTS: "--add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
jobs:
build:
@@ -25,6 +28,8 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Maven Install (skipTests)
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B install -DskipTests -D enable-ci --file pom.xml
site:
name: site (Java ${{ matrix.java }})
@@ -67,9 +72,21 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# JDK 8
- name: Maven Install without Code Coverage
if: matrix.os == 'windows'
if: matrix.os == 'windows' && matrix.java == '8'
run: mvn -B install --file pom.xml
- name: Maven Install with Code Coverage
if: matrix.os != 'windows'
if: matrix.os != 'windows' && matrix.java == '8'
run: mvn -B install -D enable-ci --file pom.xml
# JDK 11+
- name: Maven Install without Code Coverage
if: matrix.os == 'windows' && matrix.java != '8'
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B install --file pom.xml
- name: Maven Install with Code Coverage
if: matrix.os != 'windows' && matrix.java != '8'
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B install -D enable-ci --file pom.xml