In pom.xml we can configure maven.compiler.source maven.compiler.target properties to tell Maven to use Java 8 (or particular Java version ) to compile the project.
We can configure Java Version using Maven properties. Sample Maven properties for Java 7 and Java 8 given below.
Java 7
pom.xml
Setting the -source and -target of the Java Compiler
Sometimes when you may need to compile a certain project to a different version than what you are currently using. The javac can accept such command using -source and -target.We can configure Java Version using Maven properties. Sample Maven properties for Java 7 and Java 8 given below.
Maven Properties
Java 7
pom.xml
Java 8 pom.xml1.7 1.7
Alternatively we can configure Java Version using Maven Compiler plugin.1.8 1.8
Maven Compiler Plugin
pom.xmlorg.apache.maven.plugins maven-compiler-plugin 3.6.1 1.8 1.8
0 comments:
Post a Comment