title: I am using Lombok in a Spring project but Maven build fails
body: <p>I want to add Lombok to my Spring project. I'm using  I use Maven, so I put the lombok dependency on my pom.xml file.<br>
  Here is the dependency part of my pom.xml file:</p>
  
  <pre><code>&lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-mail&lt;/artifactId&gt;
              &lt;version&gt;2.0.1.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
              &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
              &lt;version&gt;${logback.version}&lt;/version&gt;
              &lt;!-- scope&gt;test&lt;/scope--&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.12&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mockito&lt;/groupId&gt;
              &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
              &lt;version&gt;1.10.19&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;xml-apis&lt;/groupId&gt;
              &lt;artifactId&gt;xml-apis&lt;/artifactId&gt;
              &lt;version&gt;1.4.01&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;xmlunit&lt;/groupId&gt;
              &lt;artifactId&gt;xmlunit&lt;/artifactId&gt;
              &lt;version&gt;1.6&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
              &lt;version&gt;2.44.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.opera&lt;/groupId&gt;
              &lt;artifactId&gt;operadriver&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
              &lt;version&gt;1.5&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
                      &lt;artifactId&gt;selenium-remote-driver&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.19.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/org.codehaus.sonar-plugins.java/sonar-jacoco-listeners --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.codehaus.sonar-plugins.java&lt;/groupId&gt;
              &lt;artifactId&gt;sonar-jacoco-listeners&lt;/artifactId&gt;
              &lt;version&gt;3.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/javax.mail/mail --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.mail&lt;/groupId&gt;
              &lt;artifactId&gt;mail&lt;/artifactId&gt;
              &lt;version&gt;1.4&lt;/version&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;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;dependency&gt;
              &lt;groupId&gt;com.h2database&lt;/groupId&gt;
              &lt;artifactId&gt;h2&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-test-autoconfigure&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
              &lt;artifactId&gt;lombok&lt;/artifactId&gt;
              &lt;version&gt;1.16.20&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  
  <p>When I try to run maven with "mvn clean install", the build fails and I can't find the reason. Here is the log:</p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO] 
  [INFO] ------------------------------------------------------------------------
  [INFO] Building project-management 1.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ project-management ---
  [INFO] Deleting /Users/domingosmartins/git/switch-2017-g003/target
  [INFO] 
  [INFO] --- jacoco-maven-plugin:0.7.9:prepare-agent (default-prepare-agent) @ project-management ---
  [INFO] argLine set to -javaagent:/Users/domingosmartins/.m2/repository/org/jacoco/org.jacoco.agent/0.7.9/org.jacoco.agent-0.7.9-runtime.jar=destfile=/Users/domingosmartins/git/switch-2017-g003/target/jacoco.exec
  [INFO] 
  [INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ project-management ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] Copying 1 resource
  [INFO] Copying 3 resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ project-management ---
  [INFO] Changes detected - recompiling the module!
  [INFO] Compiling 138 source files to /Users/domingosmartins/git/switch-2017-g003/target/classes
  [INFO] -------------------------------------------------------------
  [WARNING] COMPILATION WARNING : 
  [INFO] -------------------------------------------------------------
  [WARNING] No processor claimed any of these annotations: org.springframework.web.bind.annotation.PathVariable,org.springframework.beans.factory.annotation.Autowired,org.springframework.web.bind.annotation.RequestMapping,org.springframework.stereotype.Controller,org.springframework.web.bind.annotation.RequestBody,javax.persistence.Table,org.springframework.stereotype.Service,com.fasterxml.jackson.annotation.JsonIgnore,javax.persistence.Enumerated,org.springframework.web.bind.annotation.ExceptionHandler,org.springframework.stereotype.Repository,javax.persistence.ManyToMany,javax.persistence.Id,org.springframework.web.bind.annotation.ControllerAdvice,javax.persistence.Entity,javax.persistence.ManyToOne,com.fasterxml.jackson.annotation.JsonBackReference,org.springframework.boot.autoconfigure.SpringBootApplication,javax.transaction.Transactional,javax.persistence.JoinColumn,javax.persistence.OneToMany,org.springframework.web.bind.annotation.RestController,javax.persistence.OneToOne,javax.persistence.Column,org.springframework.stereotype.Component,javax.persistence.GeneratedValue,javax.persistence.Transient,javax.annotation.PostConstruct,org.springframework.web.bind.annotation.RequestHeader,com.fasterxml.jackson.annotation.JsonManagedReference
  [INFO] 1 warning
  [INFO] -------------------------------------------------------------
  [INFO] -------------------------------------------------------------
  [ERROR] COMPILATION ERROR : 
  [INFO] -------------------------------------------------------------
  [ERROR] warnings found and -Werror specified
  [INFO] 1 error
  [INFO] -------------------------------------------------------------
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 6.878 s
  [INFO] Finished at: 2018-04-10T15:16:57+01:00
  [INFO] Final Memory: 36M/294M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project project-management: Compilation failure
  [ERROR] warnings found and -Werror specified
  [ERROR] 
  [ERROR] -&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/MojoFailureException
  </code></pre>
  
  <p>I'm using IntelliJ and had already checked "Enable annotation processing" (Preferences -> Build, Execution, Deployment -> Compiler -> Annotation Processors).</p>
  
  <p>When I run mvn clean install -e:</p>
  
  <pre><code>[INFO] Error stacktraces are turned on.
  [INFO] Scanning for projects...
  [INFO] 
  [INFO] ------------------------------------------------------------------------
  [INFO] Building project-management 1.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ project-management ---
  [INFO] Deleting /Users/domingosmartins/git/switch-2017-g003/target
  [INFO] 
  [INFO] --- jacoco-maven-plugin:0.7.9:prepare-agent (default-prepare-agent) @ project-management ---
  [INFO] argLine set to -javaagent:/Users/domingosmartins/.m2/repository/org/jacoco/org.jacoco.agent/0.7.9/org.jacoco.agent-0.7.9-runtime.jar=destfile=/Users/domingosmartins/git/switch-2017-g003/target/jacoco.exec
  [INFO] 
  [INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ project-management ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] Copying 1 resource
  [INFO] Copying 3 resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ project-management ---
  [INFO] Changes detected - recompiling the module!
  [INFO] Compiling 138 source files to /Users/domingosmartins/git/switch-2017-g003/target/classes
  [INFO] -------------------------------------------------------------
  [WARNING] COMPILATION WARNING : 
  [INFO] -------------------------------------------------------------
  [WARNING] No processor claimed any of these annotations: org.springframework.web.bind.annotation.PathVariable,org.springframework.beans.factory.annotation.Autowired,org.springframework.web.bind.annotation.RequestMapping,org.springframework.stereotype.Controller,org.springframework.web.bind.annotation.RequestBody,javax.persistence.Table,org.springframework.stereotype.Service,com.fasterxml.jackson.annotation.JsonIgnore,javax.persistence.Enumerated,org.springframework.web.bind.annotation.ExceptionHandler,org.springframework.stereotype.Repository,javax.persistence.ManyToMany,javax.persistence.Id,org.springframework.web.bind.annotation.ControllerAdvice,javax.persistence.Entity,javax.persistence.ManyToOne,com.fasterxml.jackson.annotation.JsonBackReference,org.springframework.boot.autoconfigure.SpringBootApplication,javax.transaction.Transactional,javax.persistence.JoinColumn,javax.persistence.OneToMany,org.springframework.web.bind.annotation.RestController,javax.persistence.OneToOne,javax.persistence.Column,org.springframework.stereotype.Component,javax.persistence.GeneratedValue,javax.persistence.Transient,javax.annotation.PostConstruct,org.springframework.web.bind.annotation.RequestHeader,com.fasterxml.jackson.annotation.JsonManagedReference
  [INFO] 1 warning
  [INFO] -------------------------------------------------------------
  [INFO] -------------------------------------------------------------
  [ERROR] COMPILATION ERROR : 
  [INFO] -------------------------------------------------------------
  [ERROR] warnings found and -Werror specified
  [INFO] 1 error
  [INFO] -------------------------------------------------------------
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 5.603 s
  [INFO] Finished at: 2018-04-12T01:06:27+01:00
  [INFO] Final Memory: 36M/288M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project project-management: Compilation failure
  [ERROR] warnings found and -Werror specified
  [ERROR] 
  [ERROR] -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project project-management: Compilation failure
  warnings found and -Werror specified
  
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
      at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
  Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
  warnings found and -Werror specified
  
      at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1161)
      at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
      at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
  [ERROR] 
  [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/MojoFailureException
  </code></pre>