Skip to content

Commit

Permalink
Fixes piranhacloud#3540 - Update to Java 21 (piranhacloud#3561)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Oct 14, 2023
1 parent a21b0e0 commit 6676719
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 100 deletions.
66 changes: 10 additions & 56 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ '17', '20' ]
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Setup Java
- name: Setup Java 21
uses: actions/setup-java@v3
with:
cache: 'maven'
distribution: 'temurin'
java-version: ${{ matrix.java }}
java-version: 21
- name: Build with Maven
run: mvn --no-transfer-progress -B install
- name: Publish Unit Test Results
Expand All @@ -46,12 +45,12 @@ jobs:
uses: github/codeql-action/init@v2
with:
languages: 'java'
- name: Setup Java
- name: Setup Java 21
uses: actions/setup-java@v3
with:
cache: 'maven'
distribution: 'temurin'
java-version: '17'
java-version: '21'
- name: Build with Maven
run: mvn -B -DskipTests=true -DskipITs=true --ntp install
- name: Perform CodeQL Analysis
Expand All @@ -62,12 +61,12 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set up Java
- name: Set up Java 21
uses: actions/setup-java@v3
with:
cache: 'maven'
distribution: 'temurin'
java-version: 17
java-version: 21
- name: Build with Maven
run: mvn -B -Dmaven.javadoc.skip=true -DskipTests=true -DskipITs=true -ntp -P '!test' verify
- name: Login to GHCR
Expand Down Expand Up @@ -123,63 +122,18 @@ jobs:
mvn -B -Dmaven.javadoc.skip=true -DskipTests=true -DskipITs=true -ntp -P '!test' install
cd dist/webprofile
mvn -B -DskipTests=true -DskipITs=true -ntp -P docker deploy
early-access:
if: github.repository == 'piranhacloud/piranha'
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
java: [ 'EA' ]
os: [ubuntu-latest]
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Setup Java ${{ matrix.java }}
uses: oracle-actions/setup-java@v1
with:
website: jdk.java.net
release: ${{ matrix.java }}
- name: Build with Maven
run: mvn -B --ntp install -Djacoco.skip=true
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: '**/target/surefire-reports/*.xml'
sonarcloud:
if: github.repository == 'piranhacloud/piranha' && github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
- name: Analyze with SonarCloud
run: |
mvn -B -ntp install verify site \
sonar:sonar -Dsonar.projectKey=piranhacloud_piranha \
-Dsonar.organization=piranhacloud -Dsonar.host.url=https://sonarcloud.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
sonatype:
if: github.repository == 'piranhacloud/piranha' && github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set up Java
- name: Set up Java 21
uses: actions/setup-java@v3
with:
cache: 'maven'
distribution: 'temurin'
java-version: 20
java-version: 21
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand All @@ -201,12 +155,12 @@ jobs:
token: ${{ secrets.GIT_PASSWORD }}
path: piranha-website
ref: 'gh-pages'
- name: Set up Java
- name: Set up Java 21
uses: actions/setup-java@v3
with:
cache: 'maven'
distribution: 'temurin'
java-version: 20
java-version: 21
- name: Build with Maven
run: |
mvn -B -DskipTests -DskipITs -ntp install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set up Java
- name: Set up Java 21
uses: actions/setup-java@v3
with:
cache: 'maven'
distribution: 'temurin'
java-version: 20
java-version: 21
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tck-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '17' ]
java: [ '21' ]
os: [ubuntu-latest]
steps:
- name: Checkout Sources
Expand All @@ -32,7 +32,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '17' ]
java: [ '21' ]
os: [ubuntu-latest]
steps:
- name: Checkout sources
Expand All @@ -55,7 +55,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '17' ]
java: [ '21' ]
os: [ubuntu-latest]
steps:
- name: Checkout sources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.Set;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
Expand Down
36 changes: 0 additions & 36 deletions extension/scinitializer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,40 +45,4 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.80</minimum>
</limit>
<limit>
<counter>CLASS</counter>
<value>MISSEDCOUNT</value>
<maximum>0</maximum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
<tidy-maven-plugin.version>1.2.0</tidy-maven-plugin.version>
<versions-maven-plugin.version>2.16.0</versions-maven-plugin.version>
<!-- other -->
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down Expand Up @@ -852,7 +853,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<release>17</release>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
Expand All @@ -870,7 +871,7 @@
<version>3.8.7</version>
</requireMavenVersion>
<requireJavaVersion>
<version>17</version>
<version>${java.version}</version>
</requireJavaVersion>
</rules>
</configuration>
Expand Down

0 comments on commit 6676719

Please sign in to comment.