Skip to content

Commit

Permalink
Upgrade to Java 17 [HZ-4160] (#291)
Browse files Browse the repository at this point in the history
Changes:
- Update release actions to use Java 17 JDK
   - centralised configuration for easier future updates
- Updated code level to 17

Fixes [HZ-4160](https://hazelcast.atlassian.net/browse/HZ-4160)

[HZ-4160]: https://hazelcast.atlassian.net/browse/HZ-4160?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
JackPGreen authored Jan 26, 2024
1 parent 9cc07b9 commit 1be2db4
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .github/java-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
java-version: "17"
distribution: "temurin"
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ jobs:
build:
if: github.repository_owner == 'hazelcast'
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11' ]
architecture: [ 'x64' ]
distribution: [ 'temurin' ]
name: Build
steps:
- uses: actions/checkout@v4
- name: Read Java Config
uses: pietrobolcato/[email protected]
id: java-config
with:
config: ${{ github.workspace }}/.github/java-config.yml
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
architecture: ${{ matrix.architecture }}
distribution: ${{ matrix.distribution }}
java-version: ${{ steps.java-config.outputs['java-version'] }}
architecture: 'x64'
distribution: ${{ steps.java-config.outputs['distribution'] }}
cache: 'maven'

- name: Build with Maven
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@ jobs:
with:
ref: ${{ github.event.inputs.release-branch }}
token: ${{ secrets.GH_PAT }}
- name: Read Java Config
uses: pietrobolcato/[email protected]
id: java-config
with:
config: ${{ github.workspace }}/.github/java-config.yml
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
java-version: ${{ steps.java-config.outputs['java-version'] }}
distribution: ${{ steps.java-config.outputs['distribution'] }}
server-id: deploy-repository
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/deploy-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ jobs:
build:
if: github.repository_owner == 'hazelcast'
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11' ]
architecture: [ 'x64' ]
distribution: [ 'temurin' ]
name: Build SNAPSHOT version with JDK ${{ matrix.java }}
name: Build SNAPSHOT version
steps:
- uses: actions/checkout@v4
- name: Read Java Config
uses: pietrobolcato/[email protected]
id: java-config
with:
config: ${{ github.workspace }}/.github/java-config.yml
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.distribution }}
java-version: ${{ steps.java-config.outputs['java-version'] }}
distribution: ${{ steps.java-config.outputs['distribution'] }}
server-id: deploy-repository
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
architecture: ${{ matrix.architecture }}
architecture: 'x64'
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
cache: 'maven'
Expand Down
5 changes: 4 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<properties>
<main.basedir>${project.basedir}</main.basedir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<jdk.version>17</jdk.version>
<hazelcast.version>5.3.6</hazelcast.version>
<mockito.version>5.10.0</mockito.version>
<maven.jacoco.plugin.version>0.8.11</maven.jacoco.plugin.version>
Expand Down Expand Up @@ -169,6 +169,9 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
<configuration>
<release>${jdk.version}</release>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
1 change: 0 additions & 1 deletion smoke-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<artifactId>smoke-test</artifactId>

<properties>
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down

0 comments on commit 1be2db4

Please sign in to comment.