Skip to content

Commit

Permalink
Build and run SonarScanner with Java 17 (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
joschi authored Nov 5, 2023
1 parent e810766 commit cb3d6a5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: ['11']
java_version: ['17']
os: ['ubuntu-latest']
env:
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
Expand All @@ -27,7 +27,7 @@ jobs:
java-version: ${{ matrix.java_version }}
cache: 'maven'
- name: Cache SonarCloud packages
if: matrix.java_version == '11'
if: matrix.java_version == '17'
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: ~/.sonar/cache
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Build
run: ./mvnw -B -V -ntp install
- name: Analyze with SonarCloud
if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '17' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3
with:
java-version: '11'
java-version: '17'
distribution: 'zulu'
cache: 'maven'
server-id: ossrh
Expand Down
18 changes: 12 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.showWarnings>true</maven.compiler.showWarnings>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
<maven.compiler.optimize>false</maven.compiler.optimize>
<maven.compiler.forceJavacCompilerUse>true</maven.compiler.forceJavacCompilerUse>

<maven.site.deploy.skip>true</maven.site.deploy.skip>
Expand Down Expand Up @@ -236,10 +235,20 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<fork>true</fork>
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne -Xep:NullAway:ERROR -XepOpt:NullAway:AnnotatedPackages=io.dropwizard
</arg>
<arg>-Xplugin:ErrorProne -Xep:NullAway:ERROR -XepOpt:NullAway:AnnotatedPackages=io.dropwizard</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
Expand Down Expand Up @@ -345,9 +354,6 @@
<profiles>
<profile>
<id>release</id>
<properties>
<maven.compiler.optimize>true</maven.compiler.optimize>
</properties>
<build>
<plugins>
<plugin>
Expand Down

0 comments on commit cb3d6a5

Please sign in to comment.