Configure Maven to use Java 8 for Compile the code
In pom.xml we can configure maven.compiler.sourcemaven.compiler.target properties to tell Maven to use Java 8 (or particular Java version ) to compile the project.
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 7pom.xml
1.71.7
Java 8pom.xml
1.81.8
Alternatively we can configure Java Version using Maven Compiler plugin.
0 comments:
Post a Comment