[
https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090976#comment-17090976
]
Tibor Digana commented on SUREFIRE-1262:
----------------------------------------
[~Pavel_K]
>> Put only those that are required in module-info of the module that is being
>> tested and in module-info of its dependencies.
It is exactly what we are doing and we use {{plexus-java}} for that as
[~rfscholte] mentioned. See your printed line {{Lets see JDKModulePath}} -
there is the {{com.foo.api}} module on module path.
>> Let's think this way - on module path we put only those jar that either have
>> module-info or are required in module-info (so some module is going to use
>> it as automatic module).
The automatic modules are on th emodule path. I checked!
Maybe what we can do for you more is to print these errors as soon as the JVM
corrupts the native stream with:
{noformat}
Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.ws.rs not found, required by
com.foo.api
{noformat}
Do you want to open a new issue and fix it? It's very easy, just extend [this
condition|https://github.com/apache/maven-surefire/blob/master/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/EventConsumerThread.java#L227]
making a lookup for the above two strings.
> Add modulepath support
> ----------------------
>
> Key: SUREFIRE-1262
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1262
> Project: Maven Surefire
> Issue Type: Improvement
> Reporter: Robert Scholte
> Assignee: Tibor Digana
> Priority: Major
> Fix For: 2.21.0
>
>
> With the Jigsaw project Java9 is extended with a modulepath. This means that
> surefire should be executed in a different way.
> When working with a modulepath, the Classpath in the MANIFEST of the
> executable jar will be ignored, you need need to add everything on
> commandline.
> Just like javadoc, the java executable has an {{@<file>}} option, where you
> can add arguments per line. So this is the new preferred way to build the
> module-path.
> IIUC for surefire it is important to add {{--patch-module
> target/test-classes}} (was: -Xpatch) which makes it possible to use the same
> packages as target/classes.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)