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

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

[~tibordigana] You said that you fixed my problem by adding to com.foo.api the 
following code:


{code:java}
<dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
   <version>2.3.1</version>
</dependency>
<dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>javax.ws.rs-api</artifactId>
        <version>2.1.1</version>
</dependency>
{code}


Ok, lets see. For simplicity let's throw out java.persistence. This is 
module-info of com.foo.api


{code:java}
module com.foo.api {
    requires org.slf4j;
    requires java.ws.rs;
    requires java.xml.bind;
}

{code}

In pom of com.foo.api we have:

{code:java}
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
          <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
        </dependency>
{code}


In slf4j-api-1.8.0-beta2.jar there is a module-info: module org.slf4j { ....}
In jakarta.ws.rs-api-2.1.6.jar there is a module-info: module java.ws.rs {...}
In jakarta.xml.bind-api-2.3.2.jar there is a module-info: module java.xml.bind 
{...}

So, trying to build foo project I get:

{code:java}
Failed to execute goal 
org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test (default-test) on 
project com.foo.plugin: There are test failures.

Error occurred in starting fork, check output in log
Process Exit Code: 1
org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM 
terminated without properly saying goodbye. VM crash or System.exit called?
....
Error occurred in starting fork, check output in log
Process Exit Code: 1
        at 
org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:690)
        at 
org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:285)
        at 
org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:248)

{code}

Say, please, do you still think that my code is not correct and it is necessary 
to add the dependencies that you listed OR the problem is in surefire plugin? 
To tell the truth it is the third day while we are talking and only same talks. 
So, let's understand either we fix something or stop talking.

> 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