Skip to content

Commit

Permalink
Switch to use JDK11 for CI and Docker images (apache#10580)
Browse files Browse the repository at this point in the history
### Motivation

There has been discussions on the Pulsar dev mailing list and in Pulsar Community meetings about making the switch to use JDK11 for CI and for the Pulsar docker images in 2.8.0 release.
The code is kept binary compatible with Java 8 and is compiled in JDK 11 with the `--release 8` javac option.

### Modifications

- Use Java 11 to run all GitHub Actions builds
- Switch base images of docker images from OpenJDK 8 to OpenJDK 11.
- Fix dependencies and license files when using JDK 11.
  • Loading branch information
lhotari authored May 13, 2021
1 parent 5f09de8 commit eee622c
Show file tree
Hide file tree
Showing 37 changed files with 157 additions and 106 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci-build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ jobs:
restore-keys: |
${{ runner.os }}-m2-dependencies-all-
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
uses: actions/setup-java@v1
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11


- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-cpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
restore-keys: |
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: clean disk
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-integration-backwards-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
uses: actions/setup-java@v1
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-integration-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-integration-function.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-integration-messaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-integration-process.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-integration-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-integration-sql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-integration-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-integration-thread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-integration-tiered-filesystem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-integration-tiered-jcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-integration-transaction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci-license.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
uses: actions/setup-java@v1
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11


- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-maven-cache-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ jobs:
# on growing from old entries which wouldn't never expire if the old
# cache would be used as the starting point for a new cache entry

- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ (github.event_name == 'schedule' || steps.changes.outputs.poms == 'true') && steps.cache.outputs.cache-hit != 'true' }}
uses: actions/setup-java@v1
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ (github.event_name == 'schedule' || steps.changes.outputs.poms == 'true') && steps.cache.outputs.cache-hit != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-pulsar-website-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
run: sudo ./build/replace_maven-wagon-http-version.sh
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-shade-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ jobs:
${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-unit-broker-broker-gp1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
restore-keys: |
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-unit-broker-broker-gp2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
restore-keys: |
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-unit-broker-client-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
restore-keys: |
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-unit-broker-client-impl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
restore-keys: |
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-unit-broker-other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
restore-keys: |
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-unit-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ jobs:
restore-keys: |
${{ runner.os }}-m2-dependencies-core-modules-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
with:
java-version: 1.8
distribution: 'adopt'
java-version: 11

- name: Replace maven's wagon-http version
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
Expand Down
Loading

0 comments on commit eee622c

Please sign in to comment.