[ 
https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090529#comment-17090529
 ] 

Pavel_K commented on SUREFIRE-1262:
-----------------------------------

So, one by one 

1) --module-path ... 
C:\\vcs\\github\\surefire-jpms\\com.foo.plugin\\target\\classes; - I don't know 
if it is correct. I worked only with jars and directories containing jars, but 
if it works...

2) --class-path ... 
C:\\vcs\\github\\surefire-jpms\\com.foo.plugin\\target\\test-classes; 
    ....
    --patch-module 
com.foo.plugin="C:\\vcs\\github\\surefire-jpms\\com.foo.plugin\\target\\test-classes"
Maybe we need to leave only `--patch-module`? Or it doesn't work if they are 
not on class path?

3) --add-modules com.foo.plugin .. to tell the truth I don't understand it. We 
do have it on module path, see #1.

4) I would also try to add --add-opens com.foo.plugin/com.foo.plugin=ALL-UNNAMED

If my notes don't help, you can ask about best JPMS configuration for unit 
testing in jigsaw-dev mailing list. They give very good answers.

> 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)

Reply via email to