You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Russell Gold <ru...@oracle.com> on 2017/03/03 12:42:45 UTC

Build using toolchains version, but run unit tests against various JDKs?

I am using the toolchains plugin to ensure that the jars are produced with the correct JDK version; however, I want to be able to unit test against both that version and later versions. Is there a way to do that? The surefire plugin just selects the same version as was used to build.

Thanks,
Russ
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Build using toolchains version, but run unit tests against various JDKs?

Posted by Robert Scholte <rf...@apache.org>.
Hi Nick,

it is the latter. The simplest solution is to build and test with the same Java version and configure all variants with your CI server, especially if you consider working with multirelease jars ;)

Robert

On 13-5-2019 12:26:42, Nick Stolwijk <ni...@gmail.com> wrote:
Hello,

I found this old mail about running test multiple times with different
JDK's.

Has there been any work done to make this possible? Or is the best possible
solution to use the CI server to run multiple runs with different JDK's,
perhaps using toolchain.

With regards,

Nick Stolwijk

~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling that at any rate you
have not wasted your time but have done your best ~~~

Lord Baden-Powell


On Sat, Mar 4, 2017 at 3:31 AM Hervé BOUTEMY wrote:

> yes, using the JDK selected by the toolchain plugin was until recently the
> intent of toolchain-plugin: help being consistent in every plugin
> requiring to
> use a JDK that is different from the JRE used to launch Maven
>
> now that it works as expected, there are new use cases arising where the
> toolchain mechanism is not seen any more as a way to easily *consistently*
> select a jdk, but to easily switch between multiple JDKs *differently in
> some
> plugins executions*
>
> This is not the same use case: the toolchain definition mecanism
> (toolchain.xml) is the same, but selection algorithm is different.
>
> There was already MNG-5755 [1] implemented in Maven 3.3.1 to prepare hooks
> in
> Maven core and explain some use cases.
> Since then, I know some use cases have been implemented but others not
> yet:
> I'll try to link related issues in plugins that use the feature.
>
> In your use case, there is one additional issue: you want to run unit
> tests
> multiple times, each time with a different JDK configuration.
> This will require new feature in Surefire plugin, with extra care on
> usability
> issues to be sure the new configuration can be understood by normal people.
>
> Currently, there is a lot of work ongoing on Surefire: this new feature
> probably won't be first priority, but in the future, why not.
>
> Regards,
>
> Hervé
>
>
> [1] https://issues.apache.org/jira/browse/MNG-5755
>
> Le vendredi 3 mars 2017, 07:42:45 CET Russell Gold a écrit :
> > I am using the toolchains plugin to ensure that the jars are produced
> with
> > the correct JDK version; however, I want to be able to unit test against
> > both that version and later versions. Is there a way to do that? The
> > surefire plugin just selects the same version as was used to build.
> >
> > Thanks,
> > Russ
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Build using toolchains version, but run unit tests against various JDKs?

Posted by Nick Stolwijk <ni...@gmail.com>.
Hello,

I found this old mail about running test multiple times with different
JDK's.

Has there been any work done to make this possible? Or is the best possible
solution to use the CI server to run multiple runs with different JDK's,
perhaps using toolchain.

With regards,

Nick Stolwijk

~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling that at any rate you
have not wasted your time but have done your best ~~~

Lord Baden-Powell


On Sat, Mar 4, 2017 at 3:31 AM Hervé BOUTEMY <he...@free.fr> wrote:

> yes, using the JDK selected by the toolchain plugin was until recently the
> intent of toolchain-plugin: help being consistent in every plugin
> requiring to
> use a JDK that is different from the JRE used to launch Maven
>
> now that it works as expected, there are new use cases arising where the
> toolchain mechanism is not seen any more as a way to easily *consistently*
> select a jdk, but to easily switch between multiple JDKs *differently in
> some
> plugins executions*
>
> This is not the same use case: the toolchain definition mecanism
> (toolchain.xml) is the same, but selection algorithm is different.
>
> There was already MNG-5755 [1] implemented in Maven 3.3.1 to prepare hooks
> in
> Maven core and explain some use cases.
> Since then, I know some use cases have been implemented but others not
> yet:
> I'll try to link related issues in plugins that use the feature.
>
> In your use case, there is one additional issue: you want to run unit
> tests
> multiple times, each time with a different JDK configuration.
> This will require new feature in Surefire plugin, with extra care on
> usability
> issues to be sure the new configuration can be understood by normal people.
>
> Currently, there is a lot of work ongoing on Surefire: this new feature
> probably won't be first priority, but in the future, why not.
>
> Regards,
>
> Hervé
>
>
> [1] https://issues.apache.org/jira/browse/MNG-5755
>
> Le vendredi 3 mars 2017, 07:42:45 CET Russell Gold a écrit :
> > I am using the toolchains plugin to ensure that the jars are produced
> with
> > the correct JDK version; however, I want to be able to unit test against
> > both that version and later versions. Is there a way to do that? The
> > surefire plugin just selects the same version as was used to build.
> >
> > Thanks,
> > Russ
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Build using toolchains version, but run unit tests against various JDKs?

Posted by Hervé BOUTEMY <he...@free.fr>.
yes, using the JDK selected by the toolchain plugin was until recently the 
intent of toolchain-plugin: help being consistent in every plugin requiring to 
use a JDK that is different from the JRE used to launch Maven

now that it works as expected, there are new use cases arising where the 
toolchain mechanism is not seen any more as a way to easily *consistently* 
select a jdk, but to easily switch between multiple JDKs *differently in some 
plugins executions*

This is not the same use case: the toolchain definition mecanism 
(toolchain.xml) is the same, but selection algorithm is different.

There was already MNG-5755 [1] implemented in Maven 3.3.1 to prepare hooks in 
Maven core and explain some use cases.
Since then, I know some use cases have been implemented but others not yet: 
I'll try to link related issues in plugins that use the feature.

In your use case, there is one additional issue: you want to run unit tests 
multiple times, each time with a different JDK configuration.
This will require new feature in Surefire plugin, with extra care on usability 
issues to be sure the new configuration can be understood by normal people.

Currently, there is a lot of work ongoing on Surefire: this new feature 
probably won't be first priority, but in the future, why not.

Regards,

Hervé


[1] https://issues.apache.org/jira/browse/MNG-5755

Le vendredi 3 mars 2017, 07:42:45 CET Russell Gold a écrit :
> I am using the toolchains plugin to ensure that the jars are produced with
> the correct JDK version; however, I want to be able to unit test against
> both that version and later versions. Is there a way to do that? The
> surefire plugin just selects the same version as was used to build.
> 
> Thanks,
> Russ
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org