Skip to content

Drop JDK 7, raise minimum runtime to Java 8, build JDK to Java 17 - #1046

Merged
lhazlewood merged 12 commits into
1.0.xfrom
drop-jdk7-raise-java8-build-java17
Jun 5, 2026
Merged

lhazlewood merged 12 commits into
1.0.xfrom
drop-jdk7-raise-java8-build-java17

Conversation

@bdemers

@bdemers bdemers commented Apr 30, 2026

Copy link
Copy Markdown
Member
  • Java 17 is now required to build; Java 8 is the new minimum runtime
  • CI simplified: zulu job removed (existed only for JDK 7 toolchain),
    code-coverage no longer needs the sleep 90s Sonatype workaround
  • TestProvider converted from Groovy to Java: Groovy 4 cannot call
    super() on java.security.Provider due to JPMS restrictions
  • Add module.skip.jdk8.tests / module.skip.jdk11.tests root properties
    to support future modules that require JDK 17+

@bdemers
bdemers force-pushed the drop-jdk7-raise-java8-build-java17 branch 3 times, most recently from 66f07c1 to 1bdb06f Compare May 1, 2026 03:36
@bdemers
bdemers changed the base branch from master to fix-code-coverage May 1, 2026 03:36
@bdemers
bdemers force-pushed the drop-jdk7-raise-java8-build-java17 branch from 8cab2c0 to 291afa7 Compare June 3, 2026 18:36
Base automatically changed from fix-code-coverage to master June 3, 2026 18:45
@lhazlewood
lhazlewood changed the base branch from master to 1.0.x June 3, 2026 20:28
@bdemers
bdemers force-pushed the drop-jdk7-raise-java8-build-java17 branch from 291afa7 to a947dfe Compare June 3, 2026 21:04
bdemers added 3 commits June 3, 2026 17:05
- Remove all JDK 7 source/target compatibility settings
- Raise minimum required Java runtime from 7 to 8
- Set build JDK to 17; update CI to use temurin 17 for code-coverage job
- Add coveralls <sourceDirectories> for all module test roots so
  TestProvider.java (a test fixture instrumented by Clover) is resolved
  instead of causing a 'No source found' error at report time

# Conflicts:
#	.github/workflows/ci.yml
Activate via property absence (!skip.jdk17.tests) so it runs in all
builds regardless of other active profiles. Suppress with
-Dskip.jdk17.tests when only other JDK profiles are needed.
Each jdk-N profile now activates via test.jdk.version=N property value
instead of requiring -P on the command line. A companion profile
skip-default-tests suppresses the default surefire execution whenever
test.jdk.version is set, so only the requested JDK runs tests.

Default build (no property): default-test runs on the build JDK.
Targeted run: ./mvnw test -Dtest.jdk.version=8|11|17|21|25

CI shape becomes uniform across all JDK matrix entries.
@bdemers
bdemers force-pushed the drop-jdk7-raise-java8-build-java17 branch from a947dfe to 7c9a58f Compare June 3, 2026 21:05
lhazlewood and others added 3 commits June 3, 2026 17:47
…merge back to 1.0.x

* Java 8 API compatibility changes (#1015)

- Upgraded dependencies and maven plugins to latest versions compatible with JDK 8+.
- Remove JDK 7 from CI build
- Consolidated `ci.yml` build matrix
- JDK 8 through 24 build testing
- Removed `io.jsonwebtoken.impl.lang.Function` in favor of `java.util.function.Function`
- Marked API interfaces as `@FunctionalInterface` where possible
- Migrated `io.jsonwebtoken.lang.Supplier` usages to `java.util.function.Supplier` where possible, except for `RedactedSupplier` usages.
- Breaking change: Renamed and moved `io.jsonwebtoken.lang.Supplier` to `io.jsonwebtoken.security.ConfidentialValue`
- Breaking change: Renamed `GsonSupplierSerializer` to `GsonConfidentialValueSerializer`
- Breaking change: Renamed `JacksonSupplierSerializer` to `JacksonConfidentialValueSerializer`

* Declared `@FunctionalInterface` / cleanup where feasible.

* Removing explicit Java 7 and Java 8 callouts/references now that 8 is the default/baseline.

* use release for m-compiler-p and m-javadoc-p # (#1019)

* Delete duplicate comment (#1022)

* Add tests to reach 100% Clover coverage; run coverage job on JDK 17

Cover previously-uncovered branches in ProviderKey, ProviderPrivateKey,
ProvidedPrivateKeyBuilder, KeysBridge, and JcaTemplate.JcaInstanceFactory.

On macOS these branches are only exercised by Pkcs11Test (which fails locally
due to a SoftHSM2/SunPKCS11 ECDSA incompatibility), so explicit unit tests
are added to cover them on all platforms.

Switch the CI code-coverage job from Zulu JDK 8 to Temurin JDK 17, and remove
the now-unnecessary 'sleep 90s' workaround.

* Drop JDK 7, raise minimum runtime to Java 8, build with JDK 17

- Remove all JDK 7 source/target compatibility settings
- Raise minimum required Java runtime from 7 to 8
- Set build JDK to 17; update CI to use temurin 17 for code-coverage job
- Add coveralls <sourceDirectories> for all module test roots so
  TestProvider.java (a test fixture instrumented by Clover) is resolved
  instead of causing a 'No source found' error at report time

# Conflicts:
#	.github/workflows/ci.yml

* Make jdk-17 test profile active by default

Activate via property absence (!skip.jdk17.tests) so it runs in all
builds regardless of other active profiles. Suppress with
-Dskip.jdk17.tests when only other JDK profiles are needed.

* Replace -P jdk-N activation with -Dtest.jdk.version=N property

Each jdk-N profile now activates via test.jdk.version=N property value
instead of requiring -P on the command line. A companion profile
skip-default-tests suppresses the default surefire execution whenever
test.jdk.version is set, so only the requested JDK runs tests.

Default build (no property): default-test runs on the build JDK.
Targeted run: ./mvnw test -Dtest.jdk.version=8|11|17|21|25

CI shape becomes uniform across all JDK matrix entries.

* changed surefire plugin deprecated `forkMode` usages to replacement forkCount/reuseForks equivalents.
---------

Co-authored-by: Benjamin Marwell <bmarwell@apache.org>
Co-authored-by: Ignacio Piñeyro <juanpineyrob@gmail.com>
Co-authored-by: Brian Demers <bdemers@apache.org>
- Specified surefire.argLine property for surefire runs, with an empty value for JDK 8 (since not supported on 8)
@github-actions

github-actions Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Job Requested goals Build Tool Version Build Outcome Build Scan®
build-corretto-17 verify 3.8.8 ✅ Build Scan PUBLISHED
Generated by gradle/develocity-actions

lhazlewood and others added 5 commits June 3, 2026 21:31
- Runs each job JDK version in parallel
- uses `test.jdk.version` to remove _default_ execution of test (only running the matrix target tests)
* Extract repetitive CI setup steps into a composite action

Consolidate checkout, setup-java, setup-maven, and SoftHSM steps into a reusable local composite action under `.github/actions/`.
This will help simplify maintenance and future action version updates.

* Pin GitHub Actions to commit SHAs

Use immutable commit SHAs for checkout, setup-java, and setup-maven actions:
https://docs.github.com/en/actions/reference/security/secure-use#using-third-party-actions
@lhazlewood lhazlewood added the jdk8 Changes related to migrating to JDK8 API features label Jun 4, 2026
…o do this with multi-module builds (if we do them)
@lhazlewood
lhazlewood merged commit 733c1bd into 1.0.x Jun 5, 2026
29 checks passed
@lhazlewood
lhazlewood deleted the drop-jdk7-raise-java8-build-java17 branch June 5, 2026 01:23
lhazlewood added a commit that referenced this pull request Jun 7, 2026
* Java 8 API compatibility changes (#1015):

- Upgraded dependencies and maven plugins to latest versions compatible with JDK 8+.
- Remove JDK 7 from CI build
- Consolidated `ci.yml` build matrix
- JDK 8 through 25 build testing
- Removed `io.jsonwebtoken.impl.lang.Function` in favor of `java.util.function.Function`
- Marked API interfaces as `@FunctionalInterface` where possible
- Migrated `io.jsonwebtoken.lang.Supplier` usages to `java.util.function.Supplier` where possible, except for `RedactedSupplier` usages.
- Breaking change: Renamed and moved `io.jsonwebtoken.lang.Supplier` to `io.jsonwebtoken.security.ConfidentialValue`
- Breaking change: Renamed `GsonSupplierSerializer` to `GsonConfidentialValueSerializer`
- Breaking change: Renamed `JacksonSupplierSerializer` to `JacksonConfidentialValueSerializer`
- Declared `@FunctionalInterface` / cleanup where feasible.
- Removing explicit Java 7 and Java 8 callouts/references now that 8 is the default/baseline.

---

* Maven Build: drop JDK 7, raise minimum JRE to Java 8, and minimum build JDK to Java 17 (#1046)

- Remove all JDK 7 maven source/target compatibility settings
- Raise minimum required Java runtime from 7 to 8
- Set build JDK to 17; update CI to use JDK 17 for code-coverage job
- Make jdk-17 test profile active by default
- Replace -P jdk-N activation with -Dtest.jdk.version=N property:
Each jdk-N profile now activates via test.jdk.version=N property value instead of requiring -P on the command line. A companion profile skip-default-tests suppresses the default surefire execution whenever test.jdk.version is set, so only the requested JDK runs tests.
- use release for m-compiler-p and m-javadoc-p # (#1019)
- Add tests to reach 100% Clover coverage; run coverage job on JDK 17:
- Cover previously-uncovered branches in ProviderKey, ProviderPrivateKey,
ProvidedPrivateKeyBuilder, KeysBridge, and JcaTemplate.JcaInstanceFactory.
- On macOS these branches are only exercised by Pkcs11Test (which fails locally
due to a SoftHSM2/SunPKCS11 ECDSA incompatibility), so explicit unit tests
are added to cover them on all platforms.
- Switch the CI code-coverage job to JDK 17, and remove the now-unnecessary 'sleep 90s' workaround.
- changed surefire plugin deprecated `forkMode` usages to replacement forkCount/reuseForks equivalents.
- Specified surefire.argLine property for surefire runs, with an empty value for JDK 8 (since not supported on 8)

* Update CI build matrix Java versions (#1053)
- Runs each job JDK version in parallel
- uses `test.jdk.version` to remove _default_ execution of test (only running the matrix target tests)

* Extract repetitive CI setup steps into a composite action (#1054):
Consolidate checkout, setup-java, setup-maven, and SoftHSM steps into a reusable local composite action under `.github/actions/`.
This will help simplify maintenance and future action version updates.

- Pin GitHub Actions to commit SHAs:
Use immutable commit SHAs for checkout, setup-java, and setup-maven actions:
https://docs.github.com/en/actions/reference/security/secure-use#using-third-party-actions

Default build (no property): default-test runs on the build JDK.
Targeted run: ./mvnw test -Dtest.jdk.version=8|11|17|21|25

CI shape becomes uniform across all JDK matrix entries.

---------

Co-authored-by: Brian Demers <bdemers@apache.org>
Co-authored-by: Benjamin Marwell <bmarwell@apache.org>
Co-authored-by: Ignacio Piñeyro <juanpineyrob@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jdk8 Changes related to migrating to JDK8 API features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants