Le 2025-04-01 à 08 h 37, Gary Gregory a écrit :

What Piotr describes is sadly the kind of insane setup one must have to work with JPMS and keeps me saying JPMS is something to work around, not work with.
I think that what Piotr described is a Maven issue, not a JPMS issue. The problem is that Maven 3 sometime setups JPMS in awkward ways. For example, when testing a project with a module-info.java in the test sources, Maven 3 declares `src/test/java` as the main code and `src/main/java` as the patch applied over the tests. It is not surprising that we observe weird behavior, and not really fair to blame JPMS for that.


What I really want is a --jpms-off toolchain switch...
I think that this switch already exists is some way: put everything on the classpath. However, we have few control in Maven 3 about where to place dependencies. But again, this is a Maven 3 problem, not a JPMS problem. It should be resolved in Maven 4: a developer can declare all dependencies with `<type>classpath-jar</type>` if this is really wanted.

Note, however, that if a library is modular by design, it may not work at all on the classpath. For example, the library may declare its services in module-info only, without copy in `META-INF/services`. Or it may depend on `java.lang.ModuleLayer`. No --jpms-off switch will "fix" that.

    Martin



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to