java 1.8 and java 11 using toolchains plus compiler and surefire

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

java 1.8 and java 11 using toolchains plus compiler and surefire

John Patrick
evening,

i'm having trouble testing a multi-release jar project using
toolchains. i want to test it using both java 1.8 and java 11.

i've the following structure;
src/main/java
src/main/java11
src/test/java
src/test/java11

tried both maven-surefire-plugin v 2.22.2 and 3.0.0-M3

if i set java to 1.8 and do mvn clean install, everything works but it
uses java 1.8 for the testing.

if i set java to 11 and do maven clean install, it fails starting surefire.

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

How can I test using java 1.8 then execute tests again using java 11.

What profile or toolchain settings can i configure so for a surefire
execution it uses the java version i choose?

John

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: java 1.8 and java 11 using toolchains plus compiler and surefire

Thorsten Heit-3
Hi John,

> evening,
>
> i'm having trouble testing a multi-release jar project using
> toolchains. i want to test it using both java 1.8 and java 11.
>
> i've the following structure;
> src/main/java
> src/main/java11
> src/test/java
> src/test/java11
>
> tried both maven-surefire-plugin v 2.22.2 and 3.0.0-M3
>
> if i set java to 1.8 and do mvn clean install, everything works but it
> uses java 1.8 for the testing.
>
> if i set java to 11 and do maven clean install, it fails starting
surefire.
>
> [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException:
> The forked VM terminated without properly saying goodbye. VM crash or
> System.exit called?
> [ERROR] Error occurred in starting fork, check output in log
> [ERROR] Process Exit Code: 1
> [ERROR] at
org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork
> (ForkStarter.java:669)

I've seen similar errors when executing tests under Java 11. I don't
remember the exact reason, but I guess it was one of the following:
- features available in Java 8 that were removed in Java 11
- improper module descriptor
- for example missing dependencies such as
jakarta.xml.bind:jakarta.xml.bind-api in your pom.xml when you're using
JAXB in your code


HTH

Thorsten
Reply | Threaded
Open this post in threaded view
|

Re: java 1.8 and java 11 using toolchains plus compiler and surefire

Tibor Digana
In reply to this post by John Patrick
Hi John,

See this page, the toolchain and JAXB and much more is decribed there
https://maven.apache.org/surefire/maven-surefire-plugin/java9.html

We designed Surefire to understand the compiled sources (src/main/java)
with Java Modularity.
Not the modular test sources. I think we do not have any test for such
usecase.

I am not the best berson to answer Jigsaw stuff.
Robert Sholte is the expert in this area.

We cannot help you right now because you sent a little information and the
stacktrace is not the root cause.
So you should post your GitHub project where we can investigate the error.

Cheers
Tibor17


On Sat, Aug 31, 2019 at 7:53 PM John Patrick <[hidden email]> wrote:

> evening,
>
> i'm having trouble testing a multi-release jar project using
> toolchains. i want to test it using both java 1.8 and java 11.
>
> i've the following structure;
> src/main/java
> src/main/java11
> src/test/java
> src/test/java11
>
> tried both maven-surefire-plugin v 2.22.2 and 3.0.0-M3
>
> if i set java to 1.8 and do mvn clean install, everything works but it
> uses java 1.8 for the testing.
>
> if i set java to 11 and do maven clean install, it fails starting surefire.
>
> [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException:
> The forked VM terminated without properly saying goodbye. VM crash or
> System.exit called?
> [ERROR] Error occurred in starting fork, check output in log
> [ERROR] Process Exit Code: 1
> [ERROR] at
> org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
>
> How can I test using java 1.8 then execute tests again using java 11.
>
> What profile or toolchain settings can i configure so for a surefire
> execution it uses the java version i choose?
>
> John
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: java 1.8 and java 11 using toolchains plus compiler and surefire

Tibor Digana
In reply to this post by John Patrick
Hi John,

Have you used the version 3.0.0-M4?
There were important fixes for Java 11/Linux (alt. Docker).
The message "The forked VM terminated without properly saying goodbye." is
too general error message.
Can you post the configuration of the plugin with the latest version in
your POM including the test summary? What provider you use?

Cheers
Tibor17



On Sat, Aug 31, 2019 at 7:53 PM John Patrick <[hidden email]> wrote:

> evening,
>
> i'm having trouble testing a multi-release jar project using
> toolchains. i want to test it using both java 1.8 and java 11.
>
> i've the following structure;
> src/main/java
> src/main/java11
> src/test/java
> src/test/java11
>
> tried both maven-surefire-plugin v 2.22.2 and 3.0.0-M3
>
> if i set java to 1.8 and do mvn clean install, everything works but it
> uses java 1.8 for the testing.
>
> if i set java to 11 and do maven clean install, it fails starting surefire.
>
> [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException:
> The forked VM terminated without properly saying goodbye. VM crash or
> System.exit called?
> [ERROR] Error occurred in starting fork, check output in log
> [ERROR] Process Exit Code: 1
> [ERROR] at
> org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
>
> How can I test using java 1.8 then execute tests again using java 11.
>
> What profile or toolchain settings can i configure so for a surefire
> execution it uses the java version i choose?
>
> John
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: java 1.8 and java 11 using toolchains plus compiler and surefire

John Patrick
So I've created a sample project for Java 1.8 and Java 11, in a Multi
Release jar setup and with tests that should be run to confirm the
multi release classes are being loads in the correct jvm.

https://github.com/nhojpatrick/issue-maven-multi-release-jar-testing

The README.md should have all the information needed for execution.

Once the setup for surefire is tweaks, which i've no idea what to do,
to get it working properly. I've tried looking at;
https://maven.apache.org/guides/mini/guide-using-toolchains.html
https://maven.apache.org/surefire/maven-surefire-plugin/java9.html

The surefire java9 setup only executes all tests as that java version
using toolchains, it doesn't let you do multiple tests executions each
with a different java version, like the compile plugin allows.

I would expected 3 tests to be executed, 1 test in a Java 1.8 JVM and
2 tests in a Java 11 JVM.

Hope this helps you understand what issues i'm having with multi
release jars and specifically testing when with surefire/failsafe.

I can raise as a defect if needed, it might purely be the
documentation needs to be made clearer, as things like
compileSourceRoots within the compile plugin configuration i can't
find that in the compile plugin documentation e.g. these links;
https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html
https://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html
https://maven.apache.org/plugins/maven-compiler-plugin/multirelease.html

John


On Thu, 21 Nov 2019 at 21:14, Tibor Digana <[hidden email]> wrote:

>
> Hi John,
>
> Have you used the version 3.0.0-M4?
> There were important fixes for Java 11/Linux (alt. Docker).
> The message "The forked VM terminated without properly saying goodbye." is
> too general error message.
> Can you post the configuration of the plugin with the latest version in
> your POM including the test summary? What provider you use?
>
> Cheers
> Tibor17
>
>
>
> On Sat, Aug 31, 2019 at 7:53 PM John Patrick <[hidden email]> wrote:
>
> > evening,
> >
> > i'm having trouble testing a multi-release jar project using
> > toolchains. i want to test it using both java 1.8 and java 11.
> >
> > i've the following structure;
> > src/main/java
> > src/main/java11
> > src/test/java
> > src/test/java11
> >
> > tried both maven-surefire-plugin v 2.22.2 and 3.0.0-M3
> >
> > if i set java to 1.8 and do mvn clean install, everything works but it
> > uses java 1.8 for the testing.
> >
> > if i set java to 11 and do maven clean install, it fails starting surefire.
> >
> > [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException:
> > The forked VM terminated without properly saying goodbye. VM crash or
> > System.exit called?
> > [ERROR] Error occurred in starting fork, check output in log
> > [ERROR] Process Exit Code: 1
> > [ERROR] at
> > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
> >
> > How can I test using java 1.8 then execute tests again using java 11.
> >
> > What profile or toolchain settings can i configure so for a surefire
> > execution it uses the java version i choose?
> >
> > John
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: java 1.8 and java 11 using toolchains plus compiler and surefire

John Patrick
Have decided to raise as issue so potential fixes/solutions can move
to their. https://issues.apache.org/jira/browse/SUREFIRE-1731

John

On Wed, 4 Dec 2019 at 10:55, John Patrick <[hidden email]> wrote:

>
> So I've created a sample project for Java 1.8 and Java 11, in a Multi
> Release jar setup and with tests that should be run to confirm the
> multi release classes are being loads in the correct jvm.
>
> https://github.com/nhojpatrick/issue-maven-multi-release-jar-testing
>
> The README.md should have all the information needed for execution.
>
> Once the setup for surefire is tweaks, which i've no idea what to do,
> to get it working properly. I've tried looking at;
> https://maven.apache.org/guides/mini/guide-using-toolchains.html
> https://maven.apache.org/surefire/maven-surefire-plugin/java9.html
>
> The surefire java9 setup only executes all tests as that java version
> using toolchains, it doesn't let you do multiple tests executions each
> with a different java version, like the compile plugin allows.
>
> I would expected 3 tests to be executed, 1 test in a Java 1.8 JVM and
> 2 tests in a Java 11 JVM.
>
> Hope this helps you understand what issues i'm having with multi
> release jars and specifically testing when with surefire/failsafe.
>
> I can raise as a defect if needed, it might purely be the
> documentation needs to be made clearer, as things like
> compileSourceRoots within the compile plugin configuration i can't
> find that in the compile plugin documentation e.g. these links;
> https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html
> https://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html
> https://maven.apache.org/plugins/maven-compiler-plugin/multirelease.html
>
> John
>
>
> On Thu, 21 Nov 2019 at 21:14, Tibor Digana <[hidden email]> wrote:
> >
> > Hi John,
> >
> > Have you used the version 3.0.0-M4?
> > There were important fixes for Java 11/Linux (alt. Docker).
> > The message "The forked VM terminated without properly saying goodbye." is
> > too general error message.
> > Can you post the configuration of the plugin with the latest version in
> > your POM including the test summary? What provider you use?
> >
> > Cheers
> > Tibor17
> >
> >
> >
> > On Sat, Aug 31, 2019 at 7:53 PM John Patrick <[hidden email]> wrote:
> >
> > > evening,
> > >
> > > i'm having trouble testing a multi-release jar project using
> > > toolchains. i want to test it using both java 1.8 and java 11.
> > >
> > > i've the following structure;
> > > src/main/java
> > > src/main/java11
> > > src/test/java
> > > src/test/java11
> > >
> > > tried both maven-surefire-plugin v 2.22.2 and 3.0.0-M3
> > >
> > > if i set java to 1.8 and do mvn clean install, everything works but it
> > > uses java 1.8 for the testing.
> > >
> > > if i set java to 11 and do maven clean install, it fails starting surefire.
> > >
> > > [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException:
> > > The forked VM terminated without properly saying goodbye. VM crash or
> > > System.exit called?
> > > [ERROR] Error occurred in starting fork, check output in log
> > > [ERROR] Process Exit Code: 1
> > > [ERROR] at
> > > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
> > >
> > > How can I test using java 1.8 then execute tests again using java 11.
> > >
> > > What profile or toolchain settings can i configure so for a surefire
> > > execution it uses the java version i choose?
> > >
> > > John
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]