Hi,

Didn't check in details but it can be the bytecode reader version we have
today in surefire is too old to read java 21 bytecode so it does not put
your module on module path but classpath so then, without
META-INF/services/x file it is not detected.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le dim. 15 oct. 2023 à 22:16, Mark Raynsford
<org.apache.maven.u...@io7m.com.invalid> a écrit :

> Hello!
>
> I'm seeing test failures when javac produces JDK 21 bytecode as opposed
> to JDK 20 bytecode:
>
> https://github.com/io7m/surefire-20231015
>
> You'll need JDK 21.
>
> Essentially, `mvn package` will work, but `mvn
> -Dio7m.java.targetJavaVersion=21 package` will cause a test failure.
>
> The actual root symptom is that ServiceLoader.load() will return no
> implementations, even though three implementations are registered in
> the module descriptor. I don't know why this is a problem when the
> bytecode version is 65, but not a problem when the bytecode version is
> 64.
>
> The same tests work just fine in Intellij IDEA with any bytecode
> version set.
>
> Does anyone know what's going on here?
>
> --
> Mark Raynsford | https://www.io7m.com
>
>

Reply via email to