I am getting an error when I try to run the integration test (@SpringBootTest
) in my application. I got a solution to use below the Java option
--add-opens java.base/java.nio=ALL-UNNAMED
I have checked it by editing the run configuration and it is working completely. (Run test case with above argument)
But I want to add through the pom file so when I run mvn clean install then it should work. I have tried this but it didn't work.
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
<jvmArguments>
--add-opens java.base/java.nio=ALL-UNNAMED
</jvmArguments>
</configuration>
</plugin>
I have also checked -Djava.base/java.nio=ALL-UNNAMED It is also not working. What is the right way to use this JVM argument so it can set runtime?