ascheman commented on issue #3090: URL: https://github.com/apache/maven-surefire/issues/3090#issuecomment-5016944752
Scope addition from the Maven 4 Module Source Hierarchy work (#3345 / #3392 / #3393, and desruisseaux's comment on #3392): With maven-compiler-plugin 4.x, `module-info-patch.maven` compiles tests against the module path and the compiler emits a runtime handoff file `target/test-classes/META-INF/maven/module-info-patch.args`. Surefire (since #3392) consumes its `--add-exports`/`--add-opens` directives but must still *skip* the file's `--add-reads`/`--add-modules`: the referenced modules (e.g. `org.junit.jupiter.api` via `add-modules TEST-MODULE-PATH`) sit on the classpath, so passing them through verbatim would fail the fork's boot layer. Implementing this issue unlocks the clean end state: 1. place the test-scope dependencies referenced by the test module (or by `add-modules TEST-MODULE-PATH` in `module-info-patch.maven`) on the module path, 2. pass the compiler's `module-info-patch.args` through to the forked JVM verbatim — the developer-controlled file becomes the single source of truth, and tests run with the same module options as the compilation, 3. keep surefire's auto-generated `--add-reads <m>=ALL-UNNAMED` / `--add-opens` / `--add-modules ALL-MODULE-PATH` only as a fallback when no `module-info-patch.args` exists. I'm picking this up on a branch stacked on #3392/#3394; draft PR to follow. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
