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

Akom edited comment on SUREFIRE-1234 at 4/17/20, 5:17 PM:
----------------------------------------------------------

Thanks [~tibordigana], I thought about reflection but didn't think it would be 
clean enough.  I'll take the code from compiler.

As for your other requirement (command-line toolchain specification), do you 
know if there are any built-in string-to-map facility in maven?  I'd rather not 
try to hack in [anything like 
this|https://stackoverflow.com/a/31630531/1735931]...  

Since you opened the PR for me, I can't really do anything in there (including 
Resolving Conversations).  I think I happened to make the changes that you were 
asking for (I didn't notice that you were doing that there).


was (Author: akomakom):
Thanks [~tibordigana], I thought about reflection but didn't think it would be 
clean enough.  I'll take the code from compiler.

As for your other requirement (command-line toolchain specification), do you 
know if there any built-in string-to-map facility in maven?  I'd rather not try 
to hack in [anything like this|https://stackoverflow.com/a/31630531/1735931]... 
 

Since you opened the PR for me, I can't really do anything in there (including 
Resolving Conversations).  I think I happened to make the changes that you were 
asking for (I didn't notice that you were doing that there).

> Allow to configure JVM for tests by referencing a toolchain entry
> -----------------------------------------------------------------
>
>                 Key: SUREFIRE-1234
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1234
>             Project: Maven Surefire
>          Issue Type: New Feature
>            Reporter: Gunnar Morling
>            Priority: Major
>             Fix For: 3.0.0-M5
>
>
> There is the property "jvm" which allows to specify a specific JVM to run on 
> the tests through Surefire. This puts in an absolute path into my POM, 
> though, which makes the build less portable.
> Therefore I propose to allow an alternative option which allows to refer to 
> specific JDKs configured through toolchains.xml:
> {code}
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-surefire-plugin</artifactId>
>     <configuration>
>         <toolchain>
>             <jdk>
>                 <version>1.7</version>
>                 <vendor>sun</vendor>
>             </jdk>
>         </toolchains> 
>     </configuration>
> </plugin>
> {code}
> Note that this allows to use a specific toolchain just for tests, 
> independently what's configured as toolchain for the overall build through 
> the maven-toolchain-plugin. This e.g. allows to run the build on JDK 8 but 
> run tests on JDK/JRE 7 (which is a frequent requirement for our projects). Or 
> one could have several Surefire executions, running tests on different Java 
> versions.
> The toolchain to use should be injectable through a property, so one can 
> easily configure it, e.g. for specific Jenkins runs: "... 
> -Dsurefire.toolchain=jdk:1.7" or "... -Dsurefire.toolchain=jdk:1.7:sun".



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to