[
https://issues.apache.org/jira/browse/SUREFIRE-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16822380#comment-16822380
]
Krzysztof Krason commented on SUREFIRE-1652:
--------------------------------------------
[~tibor17] Sorry I forgot to add the tests there.
OK, with `MAVEN_OPTS=--enable-preview` it works, but I think this is a similar
case as with the Java 9 modules. This is not a bug, but a design decision that
was made and going forward we (those that use Java) should adapt to that new
situation.
Aside from the Java bug (or feature) - I don't understand why `argLine` doesn't
work in this case? It looks like `argLine` is not passed to forked JVMs, which
looks like a real bug on surefire/failsafe side.
> surefire/failsafe fails with --enable-preview in java 12
> --------------------------------------------------------
>
> Key: SUREFIRE-1652
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1652
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Failsafe Plugin, Maven Surefire Plugin
> Affects Versions: 3.0.0-M3
> Reporter: Krzysztof Krason
> Assignee: Tibor Digana
> Priority: Blocker
>
> Minimal example: [https://github.com/krzyk/lombok-jdk10-example]
>
> When I run the build `mvn clean verify` in the above repository I get
> following error:
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test (default-test)
> on project lombok-jdk10: Execution default-test of goal
> org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test failed:
> java.lang.UnsupportedClassVersionError: Preview features are not enabled for
> com/kirela/lombok/BarTest (class file version 56.65535). Try running with
> '--enable-preview' -> [Help 1]
>
> Tests work when I remove `--enable-preview` from compiler OR when I remove
> "forkCount" from surefire (and failsafe) configuration.
> As I understand argLine property should be used in all forks, but appears to
> be ignored, there is no difference if I use it as a property or as a
> configuration paramater in surefire/failsafe.
>
> This bug makes using Java 12 with preview features unusable with
> surefire/failsafe.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)