Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.0.0-M5
-
None
-
None
Description
Hi there,
the other day I was playing around with incubator code from JDK16 and noticed odd behavior wrt the reuseForks configuration.
In order to compile and run tests, my project needs the jdk.incubator.foreign module. So I configured it like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<reuseForks>false</reuseForks>
<forkCount>1</forkCount>
<argLine>-Dforeign.restricted=permit --add-modules=jdk.incubator.foreign</argLine>
</configuration>
</plugin>
Which results in
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project de.itemis.mosig.sfrf: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test failed: org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests: ClassSelector [className = 'de.itemis.mosig.sfrf.AppTest'] resolution failed: jdk/incubator/foreign/MemoryLayout: jdk.incubator.foreign.MemoryLayout -> [Help 1]
Whereas setting reuseForks to true works.
Please note that the project itself is not modularized, i. e. it does not have a module-info.java specification (on purpose).
I provided a demo for this over at GitHub: https://github.com/JanMosigItemis/sfrf
Any thoughts?