From 10ddab60c1c8b4002355f33bc61e0a53a01628fa Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 16 May 2024 13:01:07 +0200 Subject: [PATCH] build project with JDK 22 (but keep multi release jar) also account for JDK-8308398 --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/dependency-check.yml | 2 +- .github/workflows/publish-central.yml | 2 +- .github/workflows/publish-github.yml | 2 +- .idea/misc.xml | 2 +- pom.xml | 15 ++++++++++++++ src/main/java22/module-info.java | 27 ++++++++++++++++++++++++++ 8 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 src/main/java22/module-info.java diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57b9a8c..dff3a25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-java@v4 with: - java-version: 21 + java-version: 22 distribution: 'temurin' cache: 'maven' - name: Cache SonarCloud packages diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4286698..c687448 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 2 - uses: actions/setup-java@v4 with: - java-version: 21 + java-version: 22 distribution: 'temurin' cache: 'maven' - name: Initialize CodeQL diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml index 1458295..31dd104 100644 --- a/.github/workflows/dependency-check.yml +++ b/.github/workflows/dependency-check.yml @@ -14,7 +14,7 @@ jobs: with: runner-os: 'ubuntu-latest' java-distribution: 'temurin' - java-version: 21 + java-version: 22 secrets: nvd-api-key: ${{ secrets.NVD_API_KEY }} slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/publish-central.yml b/.github/workflows/publish-central.yml index afabe60..6f14836 100644 --- a/.github/workflows/publish-central.yml +++ b/.github/workflows/publish-central.yml @@ -15,7 +15,7 @@ jobs: ref: "refs/tags/${{ github.event.inputs.tag }}" - uses: actions/setup-java@v4 with: - java-version: 21 + java-version: 22 distribution: 'temurin' cache: 'maven' server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index be60dec..b590555 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - java-version: 21 + java-version: 22 distribution: 'temurin' cache: 'maven' gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import diff --git a/.idea/misc.xml b/.idea/misc.xml index 5e8e72e..a6632ff 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,5 +8,5 @@ - + \ No newline at end of file diff --git a/pom.xml b/pom.xml index f0499ac..481d2ab 100644 --- a/pom.xml +++ b/pom.xml @@ -171,6 +171,20 @@ true + + java22 + compile + + compile + + + 22 + + ${project.basedir}/src/main/java22 + + true + + @@ -228,6 +242,7 @@ --update --file=${project.build.directory}/${project.build.finalName}.jar META-INF/versions/9/module-info.class + META-INF/versions/22/module-info.class diff --git a/src/main/java22/module-info.java b/src/main/java22/module-info.java new file mode 100644 index 0000000..06e5d6a --- /dev/null +++ b/src/main/java22/module-info.java @@ -0,0 +1,27 @@ +import org.cryptomator.cryptolib.api.CryptorProvider; + +/** + * This module provides the highlevel cryptographic API used by Cryptomator. + * + * @uses CryptorProvider See {@link CryptorProvider#forScheme(CryptorProvider.Scheme)} + * @provides CryptorProvider Providers for {@link org.cryptomator.cryptolib.api.CryptorProvider.Scheme#SIV_CTRMAC SIV/CTR-then-MAC} + * and {@link org.cryptomator.cryptolib.api.CryptorProvider.Scheme#SIV_GCM SIV/GCM} + */ +module org.cryptomator.cryptolib { + requires static org.bouncycastle.provider; // will be shaded + requires static org.bouncycastle.pkix; // will be shaded + requires org.cryptomator.siv; + requires com.google.gson; + requires transitive com.google.common; + requires org.slf4j; + + exports org.cryptomator.cryptolib.api; + exports org.cryptomator.cryptolib.common; + + opens org.cryptomator.cryptolib.common to com.google.gson; + + uses CryptorProvider; + + provides CryptorProvider + with org.cryptomator.cryptolib.v1.CryptorProviderImpl, org.cryptomator.cryptolib.v2.CryptorProviderImpl; +} \ No newline at end of file