You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Marc Schlegel (Jira)" <ji...@apache.org> on 2022/04/01 13:24:00 UTC
[jira] [Created] (MNG-7450) .mvn/jvm.config not passed to surefire (--add-opens)
Marc Schlegel created MNG-7450:
----------------------------------
Summary: .mvn/jvm.config not passed to surefire (--add-opens)
Key: MNG-7450
URL: https://issues.apache.org/jira/browse/MNG-7450
Project: Maven
Issue Type: Bug
Components: Bootstrap & Build
Affects Versions: 3.8.3
Reporter: Marc Schlegel
We are on the way upgrading to Java 17 and since 17 does not allow unopened access anymore we have to pass several add-open JVM settings.
Following [this|https://maven.apache.org/configure.html] documentation, we've setup the needed instructions.
{code:java}
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/java.time=ALL-UNNAMED
{code}
We currently see two cases where add-opens is needed:
* jqassistant-plugin
* OpenPojo Library during test-phase
The jqassistant-plugin works fine with this settings (and fails without), though the surefire-plugin is not passing the jvm-options (or maven-core is not passing it to surefire).
As a workaround I have to configure surefire via argLine in addition to jvm.options
{code:java}
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<argLine>
--add-opens java.base/java.time=ALL-UNNAMED
</argLine>
<skipTests>${skipUTs}</skipTests>
<systemProperties>
<java.util.logging.manager>
org.jboss.logmanager.LogManager
</java.util.logging.manager>
</systemProperties>
<includes>
<include>**/*Test.java</include>
<include>**/*Spec.java</include>
</includes>
</configuration>
</plugin> {code}
This should not be necessary. It should be enough to configure jvm specific settings for Maven in one place.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)