You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2023/04/28 17:50:03 UTC
[logging-log4j-transform] 01/02: Bump JDK version to 17
This is an automated email from the ASF dual-hosted git repository.
pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j-transform.git
commit 16871bf843c005540c16dfe8bd5f7aa109c80368
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Fri Apr 28 18:54:08 2023 +0200
Bump JDK version to 17
We build using JDK 17, but with Java 8 bytecode.
---
.github/workflows/build.yml | 58 +++++++++++++++---------------------------
.java-version | 2 +-
.mvn/jvm.config | 11 ++++++++
log4j-transform-parent/pom.xml | 31 ++++++++++++++--------
pom.xml | 2 +-
5 files changed, 55 insertions(+), 49 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index fb7f688..a45045d 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -28,9 +28,7 @@ on:
- "**.md"
- "**.txt"
-permissions:
- contents: write
- pull-requests: write
+permissions: read-all
jobs:
@@ -47,20 +45,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # 3.5.2
- - name: Setup JDK 8
+ - name: Setup JDK 8 and 17
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # 3.7.0
with:
distribution: temurin
- java-version: 8
- java-package: jdk
- architecture: x64
- cache: maven
-
- - name: Setup JDK 11
- uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # 3.7.0
- with:
- distribution: temurin
- java-version: 11
+ java-version: |
+ 8
+ 17
java-package: jdk
architecture: x64
cache: maven
@@ -69,54 +60,47 @@ jobs:
# For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
- name: Build
shell: bash
- env:
- JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }}
run: |
./mvnw \
--show-version --batch-mode --errors --no-transfer-progress \
-DtrimStackTrace=false \
-DinstallAtEnd=true \
+ -Pjava8-tests
clean install
# `clean verify artifact:compare` is required to generate the build reproducibility report.
# For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
- name: Report build reproducibility
+ id: report-reproducible
+ timeout-minutes: 10
shell: bash
- env:
- JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }}
run: |
./mvnw \
--show-version --batch-mode --errors --no-transfer-progress \
-DskipTests=true \
clean verify artifact:compare
- - name: Verify build reproducibility
- shell: bash
- run: |
- for report_file in target/*.buildcompare **/target/*.buildcompare; do
- if ! grep -q "^ko=0$" "$report_file"; then
- echo "Spotted build reproducibility failure in \`$report_file\`:"
- cat "$report_file"
- exit 1
- fi
- done
+ - name: Upload reproducibility failure context artifacts
+ if: failure()
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # 3.1.2
+ with:
+ name: reproducibility-failure-context-${{matrix.os}}
+ path: |
+ **/target/*.buildcompare
+ **/target/*.jar
+ **/target/reference/*.jar
merge:
runs-on: ubuntu-latest
+ if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
needs: build
+ permissions:
+ contents: write
+ pull-requests: write
steps:
-
- - name: "[dependabot] Fetch metadata"
- id: metadata
- if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
- uses: dependabot/fetch-metadata@v1.4.0
- with:
- github-token: "${{ secrets.GITHUB_TOKEN }}"
-
- name: "[dependabot] Auto-merge the PR"
- if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
diff --git a/.java-version b/.java-version
index b4de394..98d9bcb 100644
--- a/.java-version
+++ b/.java-version
@@ -1 +1 @@
-11
+17
diff --git a/.mvn/jvm.config b/.mvn/jvm.config
new file mode 100644
index 0000000..6f7d1c8
--- /dev/null
+++ b/.mvn/jvm.config
@@ -0,0 +1,11 @@
+-Djava.awt.headless=true
+--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
+--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
+--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
diff --git a/log4j-transform-parent/pom.xml b/log4j-transform-parent/pom.xml
index 53fdf84..1558218 100644
--- a/log4j-transform-parent/pom.xml
+++ b/log4j-transform-parent/pom.xml
@@ -54,7 +54,6 @@
<findsecbugs-plugin.version>1.12.0</findsecbugs-plugin.version>
<maven-invoker-plugin.version>3.5.1</maven-invoker-plugin.version>
<spotbugs-maven-plugin.version>4.7.3.4</spotbugs-maven-plugin.version>
- <surefire.toolchain.range>[1.8, 9)</surefire.toolchain.range>
<surefire.version>3.0.0-M7</surefire.version>
</properties>
<dependencyManagement>
@@ -241,15 +240,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <jdkToolchain>
- <version>${surefire.toolchain.range}</version>
- </jdkToolchain>
- </configuration>
- </plugin>
<!-- Configuration here must match the one in `.editorconfig`! -->
<plugin>
<groupId>com.github.spotbugs</groupId>
@@ -275,4 +265,25 @@
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>java8-tests</id>
+ <properties>
+ <surefire.toolchain.range>[1.8, 9)</surefire.toolchain.range>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <jdkToolchain>
+ <version>${surefire.toolchain.range}</version>
+ </jdkToolchain>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/pom.xml b/pom.xml
index 62632b4..c91038f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -161,7 +161,7 @@
`minimalJavaBuildVersion` is used for enforcing the compiler version.
We will use `java.version` to enforce the target JVM byte code, which is
8. -->
- <minimalJavaBuildVersion>[11,12)</minimalJavaBuildVersion>
+ <minimalJavaBuildVersion>[17,18)</minimalJavaBuildVersion>
<java.version>8</java.version>
<!-- `project.build.outputTimestamp` is required for reproducible builds: https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
<project.build.outputTimestamp>0</project.build.outputTimestamp>