Junit 5 test cases for a Spring boot application 2.1.7.RELEASE fails build with below error in intelij.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project domain: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test failed: Unsupported class file major version 56 -> [Help 1]
using java 9 modularization
Application builds in maven and works without test cases.
used maven surefire plugin version 2.22.1 fails in command line and intellij
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>--add-modules=java.xml.ws.annotation</jvmArguments>
</configuration>
</plugin>