I\'m trying to migrate a project to Java 12, with --enable-preview.
I added --enable-preview in compiler settings:
This works for me:
mvn clean install works (with junit tests)12 (Preview) - Switch expressions
org.apache.maven.plugins
maven-compiler-plugin
3.8.1
12
--enable-preview
org.apache.maven.plugins
maven-surefire-plugin
2.22.2
--enable-preview
Environment:
jdk:
IMPLEMENTOR="Oracle Corporation"
JAVA_VERSION="12"
JAVA_VERSION_DATE="2019-03-19"
ADDITION: Similarly this approach works for java 13.