Skip to content

Commit

Permalink
Fix apache#1027: Ensure SC can be build with Java 17 (apache#1030)
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Zowalla <[email protected]>

Signed-off-by: Richard Zowalla <[email protected]>
  • Loading branch information
rzo1 authored Jan 10, 2023
1 parent 2bf2a05 commit a575df5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 20 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,29 @@

name: Java CI with Maven

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os: [ubuntu-latest]
java: [ 11, 17 ]
experimental: [false]
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- uses: actions/[email protected]
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: maven
distribution: adopt
java-version: ${{ matrix.java }}
- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn -B --no-transfer-progress package --file pom.xml
1 change: 1 addition & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
23 changes: 16 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<jetbrains.annotations.version>23.1.0</jetbrains.annotations.version>
<log4j2.version>2.19.0</log4j2.version>
<testcontainer.version>1.17.6</testcontainer.version>
<git-code-format-maven-plugin.version>4.2</git-code-format-maven-plugin.version>
</properties>

<distributionManagement>
Expand Down Expand Up @@ -119,7 +120,7 @@
<plugin>
<groupId>com.cosium.code</groupId>
<artifactId>git-code-format-maven-plugin</artifactId>
<version>3.4</version>
<version>${git-code-format-maven-plugin.version}</version>
<executions>
<!-- On commit, format the modified java files -->
<execution>
Expand All @@ -137,13 +138,21 @@
</goals>
</execution>
</executions>
<dependencies>
<!-- Enable https://github.com/google/google-java-format -->
<dependency>
<groupId>com.cosium.code</groupId>
<artifactId>google-java-format</artifactId>
<version>${git-code-format-maven-plugin.version}</version>
</dependency>
</dependencies>
<configuration>
<googleJavaFormatOptions>
<aosp>true</aosp>
<fixImportsOnly>false</fixImportsOnly>
<skipSortingImports>false</skipSortingImports>
<skipRemovingUnusedImports>false</skipRemovingUnusedImports>
</googleJavaFormatOptions>
<formatterOptions>
<googleJavaFormat.aosp>true</googleJavaFormat.aosp>
<googleJavaFormat.fixImportsOnly>false</googleJavaFormat.fixImportsOnly>
<googleJavaFormat.skipSortingImports>false</googleJavaFormat.skipSortingImports>
<googleJavaFormat.skipRemovingUnusedImports>false</googleJavaFormat.skipRemovingUnusedImports>
</formatterOptions>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit a575df5

Please sign in to comment.