When testing with the latest JDK, the test class path is not set property to recognize multi-release JARs. This is because there are only class path profiles for LTS versions.
For any given CI build, the "tip" JDK version could be anything depending on how long it has been since the build configuration was updated. So, the proper thing to do is to keep javaXX-test-classpath profiles for every JDK. But, since we know this has been broken for a long time, we also know that nobody is currently relying on this for JDKs other than 11, 17, and 21. So, we can start adding "tip" configurations for Java 23 (which is the latest JDK version as of this writing) and later.
Workaround
To work around the issue, add -Pjava21-test-classpath to your Maven launch line. This will not allow for testing of MR-JAR configurations with layers for Java 22 or 23, but few projects will have that yet, and when they do, they can update to use the parent version which includes this fix.
When testing with the latest JDK, the test class path is not set property to recognize multi-release JARs. This is because there are only class path profiles for LTS versions.
For any given CI build, the "tip" JDK version could be anything depending on how long it has been since the build configuration was updated. So, the proper thing to do is to keep
javaXX-test-classpath
profiles for every JDK. But, since we know this has been broken for a long time, we also know that nobody is currently relying on this for JDKs other than 11, 17, and 21. So, we can start adding "tip" configurations for Java 23 (which is the latest JDK version as of this writing) and later.Workaround
To work around the issue, add
-Pjava21-test-classpath
to your Maven launch line. This will not allow for testing of MR-JAR configurations with layers for Java 22 or 23, but few projects will have that yet, and when they do, they can update to use the parent version which includes this fix.