<project> [...] <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> [...] </project>
https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html