title: Intellij maven project Fatal error compiling: invalid flag: --release
body: <p>I am trying to start with Spring-boot, Maven in Intellij
  Please help me I am getting the error:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project spring-rest: Fatal error compiling: invalid flag: --release -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  Process finished with exit code 1
  </code></pre>
  
  <p><strong>My pom.xml is:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project
     xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
         &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
         &lt;groupId&gt;com.example&lt;/groupId&gt;
         &lt;artifactId&gt;spring-rest&lt;/artifactId&gt;
         &lt;version&gt;3.1.3.RELEASE&lt;/version&gt;
         &lt;packaging&gt;war&lt;/packaging&gt;
  
         &lt;name&gt;spring-rest&lt;/name&gt;
         &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  
         &lt;parent&gt;
             &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
             &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
             &lt;version&gt;2.0.0.RELEASE&lt;/version&gt;
             &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
         &lt;/parent&gt;
  
         &lt;properties&gt;
             &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
             &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
             &lt;java.version&gt;1.8&lt;/java.version&gt;
         &lt;/properties&gt;
  
         &lt;dependencies&gt;
  
             &lt;dependency&gt;
                 &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                 &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
                 &lt;version&gt;2.0.0.RELEASE&lt;/version&gt;
             &lt;/dependency&gt;
  
           &lt;dependency&gt;
             &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
             &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
           &lt;/dependency&gt;
  
             &lt;dependency&gt;
                 &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                 &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
             &lt;/dependency&gt;
             &lt;dependency&gt;
                 &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                 &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
             &lt;/dependency&gt;
  
             &lt;dependency&gt;
                 &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
                 &lt;artifactId&gt;hibernate-jpa-2.1-api&lt;/artifactId&gt;
                 &lt;version&gt;RELEASE&lt;/version&gt;
             &lt;/dependency&gt;
  
  
             &lt;dependency&gt;
                 &lt;groupId&gt;mysql&lt;/groupId&gt;
                 &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
                 &lt;scope&gt;runtime&lt;/scope&gt;
             &lt;/dependency&gt;
             &lt;dependency&gt;
                 &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                 &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
                 &lt;scope&gt;test&lt;/scope&gt;
             &lt;/dependency&gt;
         &lt;/dependencies&gt;
  
         &lt;build&gt;
             &lt;plugins&gt;
                 &lt;plugin&gt;
                     &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                     &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
                 &lt;/plugin&gt;
  
                 &lt;plugin&gt;
                     &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                     &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                     &lt;version&gt;3.7.0&lt;/version&gt;
                     &lt;configuration&gt;
                         &lt;source&gt;1.8&lt;/source&gt;
                         &lt;target&gt;1.8&lt;/target&gt;
                         &lt;release&gt;8&lt;/release&gt;
                         &lt;verbose&gt;true&lt;/verbose&gt;
                     &lt;/configuration&gt;
                 &lt;/plugin&gt;
             &lt;/plugins&gt;
         &lt;/build&gt;
  
     &lt;/project&gt;
  </code></pre>