You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tibor Digana (Jira)" <ji...@apache.org> on 2020/04/17 16:49:00 UTC
[jira] [Commented] (SUREFIRE-1459) mvn+java7 and POM with
toolchains targeting java8 fail in surefire plugin
[ https://issues.apache.org/jira/browse/SUREFIRE-1459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17085929#comment-17085929 ]
Tibor Digana commented on SUREFIRE-1459:
----------------------------------------
This happens only if you are filtering some test classes via test/includes/excludes.
Nowadays it is impossible for us to fix it because this fix requires some changes in Provider API. We have it in plan, pls see our [road map|https://maven.apache.org/surefire/maven-surefire-plugin/].
> mvn+java7 and POM with toolchains targeting java8 fail in surefire plugin
> -------------------------------------------------------------------------
>
> Key: SUREFIRE-1459
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1459
> Project: Maven Surefire
> Issue Type: Improvement
> Components: Maven Surefire Plugin
> Affects Versions: 2.20.1
> Environment: Maven 3.3.9 started with JDK 7
> (on Windows Server 2012)
> Reporter: Rüdiger Groß-Hardt
> Assignee: Tibor Digana
> Priority: Major
> Labels: toolchains
> Attachments: run-with-errors.txt, surefire-1459.zip
>
>
> We compile and test with a POM using a toolchain configuration targeting JDK 8. Maven itself runs with JDK 7. If we run tests with the maven-surefire-plugin and forkCount=1 and reuseForks=false the build fails with
> _java.lang.UnsupportedClassVersionError: SomeTestClass : Unsupported major.minor version 52.0_
> If we set reuseForks=true, it builds fine. Other combinations seem to fail, if the plugin code running in the JDK 7 context presumably needs to use reflections to enumerate test classes.
> As newbies to toolchains, we were assuming, that toolchains enabled us to effectively decouple the JDK version used to run maven from the JDK version used to run the tests.
> This problem took us quite some time to solve. As an improvement I would suggest a meaningful warning or error message stating that the surefire plugin must be run with a JDK version higher than or equal to the version of the target JDK from the toolchain configuration.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)