Time for action – adding Java version properties in pom.xml

We successfully added all the required jars to our project, but we need to perform one small configuration in our pom.xml file, that is, telling Maven to use Java Version 7 while building our project. How do we tell Maven to do this? Simply add two property entries in pom.xml. Let's do this.

  1. Open pom.xml. You will see some tabs at the bottom of pom.xml; select the Overview tab from the bottom of pom.xml, expand the properties accordion, and click on the Create button.
  2. Now, an Add property window will appear; enter Name as maven.compiler.source and Value as 1.7.
    Time for action – adding Java version properties in pom.xml

    Adding the Java compiler version ...

Get Spring MVC Beginner’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.