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

Tibor Digana commented on SUREFIRE-1262:
----------------------------------------

[~Pavel_K]
Not necessary to stop talking but i want to show you where the problems are in 
your project.
You have a project {{com.foo.plugin}} which depends on project {{com.foo.api}}. 
You have declared dependencies in {{com.foo.api}} and you are managing the 
dependencies in the parent POM. This should be used in order to have the 
versions in one place without the scope. And the provlem is the scope. This way 
the Jakarta EE artifacts could not be inherited to the {{com.foo.plugin}} and 
the Surefire in {{com.foo.plugin}} could not see them. That's the reason why 
the JVM says:
*Error occurred during initialization of boot layer*
*java.lang.module.FindException: Module java.ws.rs not found, required by 
com.foo.api*

The way how i added another artifacts of the old JAVAX i have only bypased the 
problem of wrongly written parent POM. Pls remove these lines and it should be 
fine:
https://github.com/PashaTurok/surefire-jpms/blob/master/pom.xml#L55
https://github.com/PashaTurok/surefire-jpms/blob/master/pom.xml#L62
https://github.com/PashaTurok/surefire-jpms/blob/master/pom.xml#L68
https://github.com/PashaTurok/surefire-jpms/blob/master/pom.xml#L87

If you need to have such a scope, then repeat the artifacts in 
{{com.foo.plugin}}, this means WS and JAXB and the test would work again 
because all the declared modules will appear on the module path.

> 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