Skip to content

Commit ea3cbd4

Browse files
committed
Pass appropriate MAVEN_OPTS for JDK 11+
They are required by spotless starting JDK 16+
1 parent 34a1f9d commit ea3cbd4

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/maven-build.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: CI
22

33
on: [push, pull_request]
44

5+
# this is required by spotless for JDK 16+
6+
env:
7+
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"
58

69
jobs:
710
build:
@@ -25,6 +28,8 @@ jobs:
2528
restore-keys: |
2629
${{ runner.os }}-maven-
2730
- name: Maven Install (skipTests)
31+
env:
32+
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
2833
run: mvn -B install -DskipTests -D enable-ci --file pom.xml
2934
site:
3035
name: site (Java ${{ matrix.java }})
@@ -67,9 +72,21 @@ jobs:
6772
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
6873
restore-keys: |
6974
${{ runner.os }}-maven-
75+
# JDK 8
7076
- name: Maven Install without Code Coverage
71-
if: matrix.os == 'windows'
77+
if: matrix.os == 'windows' && matrix.java == '8'
7278
run: mvn -B install --file pom.xml
7379
- name: Maven Install with Code Coverage
74-
if: matrix.os != 'windows'
80+
if: matrix.os != 'windows' && matrix.java == '8'
81+
run: mvn -B install -D enable-ci --file pom.xml
82+
# JDK 11+
83+
- name: Maven Install without Code Coverage
84+
if: matrix.os == 'windows' && matrix.java != '8'
85+
env:
86+
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
87+
run: mvn -B install --file pom.xml
88+
- name: Maven Install with Code Coverage
89+
if: matrix.os != 'windows' && matrix.java != '8'
90+
env:
91+
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
7592
run: mvn -B install -D enable-ci --file pom.xml

0 commit comments

Comments
 (0)