Skip to content
Advertisement

how to pass –add-opens JDK module configuration to maven test

I’m upgrading java version in our production code from java 8 to java 11.

I have to add the below JDK module configuration in the application java start command due to usage of third party libraries like flume, zookeeper etc.

--add-opens java.base/java.lang=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED

After adding this configuration and java application is starting fine.

But when I run the tests using mvn test the tests are failing. I’ve added the below configuration to the maven-surefire-plugin but still it is throwing error.

JavaScript

I think I’m not passing the argument correctly in the maven test. Any idea what I’m doing wrong and how to fix this?

Advertisement

Answer

It is a single argLine, like:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement