Skip to content

Commit 421dbb7

Browse files
committed
feat: java 21 update
1 parent b444a72 commit 421dbb7

File tree

7 files changed

+262
-179
lines changed

7 files changed

+262
-179
lines changed

.github/workflows/gradle-ci.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will build a Java project with Gradle
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3-
41
name: Java CI with Gradle
52

63
on:
@@ -13,17 +10,16 @@ jobs:
1310
runs-on: ubuntu-20.04
1411

1512
steps:
16-
- uses: actions/checkout@v3
17-
- name: Set up JDK 17
18-
uses: actions/setup-java@v3
19-
with:
20-
java-version: '17'
21-
distribution: 'temurin'
22-
- name: Grant execute permission for gradlew
23-
run: chmod +x gradlew
24-
- name: Build and run SonarQube analysis
25-
run: ./gradlew build sonarqube
26-
env:
27-
# These two env variables are needed for sonar analysis
28-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
- uses: actions/checkout@v3
14+
- name: Set up JDK 21
15+
uses: actions/setup-java@v3
16+
with:
17+
java-version: '21'
18+
distribution: 'temurin'
19+
- name: Grant execute permission for gradlew
20+
run: chmod +x gradlew
21+
- name: Build and run SonarQube analysis
22+
run: ./gradlew build sonarqube
23+
env:
24+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/gradle-pr-builder.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,22 @@ jobs:
1414
runs-on: ubuntu-20.04
1515

1616
steps:
17-
- name: Checkout Code
18-
uses: actions/checkout@v3
19-
with:
20-
ref: ${{ github.event.pull_request.head.sha }}
21-
22-
- name: Set up JDK 17
23-
uses: actions/setup-java@v3
24-
with:
25-
java-version: '17'
26-
distribution: 'temurin'
27-
- name: Grant execute permission for gradlew
28-
run: chmod +x gradlew
29-
- name: Build and analyze with Gradle
30-
run: ./gradlew build sonarqube -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=iluwatar -Dsonar.projectKey=iluwatar_30-seconds-of-java -Dsonar.pullrequest.branch=${{ github.head_ref }} -Dsonar.pullrequest.base=${{ github.base_ref }} -Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
31-
env:
32-
# These two env variables are needed for sonar analysis
33-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
- name: Checkout Code
18+
uses: actions/checkout@v3
19+
with:
20+
ref: ${{ github.event.pull_request.head.sha }}
21+
22+
- name: Set up JDK 21
23+
uses: actions/setup-java@v3
24+
with:
25+
java-version: '21'
26+
distribution: 'temurin'
27+
28+
- name: Grant execute permission for gradlew
29+
run: chmod +x gradlew
30+
31+
- name: Build and analyze with Gradle
32+
run: ./gradlew build sonarqube -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=iluwatar -Dsonar.projectKey=iluwatar_30-seconds-of-java -Dsonar.pullrequest.branch=${{ github.head_ref }} -Dsonar.pullrequest.base=${{ github.base_ref }} -Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
33+
env:
34+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ plugins {
77
apply plugin: 'java'
88

99
java {
10-
sourceCompatibility = JavaVersion.VERSION_17
11-
targetCompatibility = JavaVersion.VERSION_17
10+
sourceCompatibility = JavaVersion.VERSION_21
11+
targetCompatibility = JavaVersion.VERSION_21
1212
}
1313

1414
configurations {

gradle/wrapper/gradle-wrapper.jar

7.75 KB
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Oct 17 07:56:20 EEST 2019
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip

0 commit comments

Comments
 (0)