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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Russell Gold-3
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Hervé BOUTEMY
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: [hidden email]
> For additional commands, e-mail: [hidden email]



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

Loading...