1<project>
2...
3 <properties>
4 <maven.compiler.source>1.8</maven.compiler.source>
5 <maven.compiler.target>1.8</maven.compiler.target>
6 </properties>
7...
8</project>
1<plugin>
2 <groupId>org.apache.maven.plugins</groupId>
3 <artifactId>maven-compiler-plugin</artifactId>
4 <version>3.8.0</version>
5 <configuration>
6 <release>13</release>
7 <compilerArgs>
8 --enable-preview
9 </compilerArgs>
10 </configuration>
11</plugin>
1<properties> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.source>1.8</maven.compiler.source></properties>