diff --git a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java index 4bbdc7e0..d091825e 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java @@ -161,6 +161,18 @@ public class TestCompilerMojo extends AbstractCompilerMojo { @Parameter(defaultValue = "${project.build.directory}/generated-test-sources/test-annotations") private File generatedTestSourcesDirectory; + /** + *
+ * When {@code true}, uses the module path when compiling with a release or target of 9+ and + * module-info.java or module-info.class is present. + * When {@code false}, always uses the class path. + *
+ * + * @since 3.11 + */ + @Parameter(defaultValue = "true") + private boolean useModulePath; + @Parameter(defaultValue = "${project.testClasspathElements}", readonly = true) private List