title: Maven Build Failure - Compiler Plugin
body: <p>I am trying to build a project in Maven and am experiencing the following error:</p>
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project webgoat-container: Fatal error compiling: java.lang.ExceptionInInitializerError: Unable to make field private com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs accessible: module jdk.compiler does not &quot;opens com.sun.tools.javac.processing&quot; to unnamed module @5d01a2eb -&gt; [Help 1]
  </code></pre>
  <p>The pom.xml of the project is:</p>
  
  <p></p>
  <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;org.owasp.webgoat&lt;/groupId&gt;
  &lt;artifactId&gt;webgoat-parent&lt;/artifactId&gt;
  &lt;packaging&gt;pom&lt;/packaging&gt;
  &lt;version&gt;8.2.1-SNAPSHOT&lt;/version&gt;
  
  &lt;name&gt;WebGoat Parent Pom&lt;/name&gt;
  &lt;description&gt;Parent Pom for the WebGoat Project. A deliberately insecure Web Application&lt;/description&gt;
  &lt;inceptionYear&gt;2006&lt;/inceptionYear&gt;
  &lt;url&gt;https://github.com/WebGoat/WebGoat&lt;/url&gt;
  
  &lt;organization&gt;
      &lt;name&gt;OWASP&lt;/name&gt;
      &lt;url&gt;https://github.com/WebGoat/WebGoat/&lt;/url&gt;
  &lt;/organization&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.4.3&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;licenses&gt;
      &lt;license&gt;
          &lt;name&gt;GNU General Public License, version 2&lt;/name&gt;
          &lt;url&gt;https://www.gnu.org/licenses/gpl-2.0.txt&lt;/url&gt;
      &lt;/license&gt;
  &lt;/licenses&gt;
  
  &lt;developers&gt;
      &lt;developer&gt;
          &lt;id&gt;mayhew64&lt;/id&gt;
          &lt;name&gt;Bruce Mayhew&lt;/name&gt;
          &lt;email&gt;webgoat@owasp.org&lt;/email&gt;
          &lt;organization&gt;OWASP&lt;/organization&gt;
          &lt;organizationUrl&gt;https://github.com/WebGoat/WebGoat&lt;/organizationUrl&gt;
      &lt;/developer&gt;
      &lt;developer&gt;
          &lt;id&gt;nbaars&lt;/id&gt;
          &lt;name&gt;Nanne Baars&lt;/name&gt;
          &lt;email&gt;nanne.baars@owasp.org&lt;/email&gt;
          &lt;organizationUrl&gt;https://github.com/nbaars&lt;/organizationUrl&gt;
          &lt;timezone&gt;Europe/Amsterdam&lt;/timezone&gt;
      &lt;/developer&gt;
      &lt;developer&gt;
          &lt;id&gt;misfir3&lt;/id&gt;
          &lt;name&gt;Jason White&lt;/name&gt;
          &lt;email&gt;jason.white@owasp.org&lt;/email&gt;
      &lt;/developer&gt;
      &lt;developer&gt;
          &lt;id&gt;zubcevic&lt;/id&gt;
          &lt;name&gt;René Zubcevic&lt;/name&gt;
          &lt;email&gt;rene.zubcevic@owasp.org&lt;/email&gt;
      &lt;/developer&gt;
      &lt;developer&gt;
          &lt;id&gt;jwayman&lt;/id&gt;
          &lt;name&gt;Jeff Wayman&lt;/name&gt;
          &lt;email/&gt;
      &lt;/developer&gt;
      &lt;developer&gt;
          &lt;id&gt;dcowden&lt;/id&gt;
          &lt;name&gt;Dave Cowden&lt;/name&gt;
          &lt;email/&gt;
      &lt;/developer&gt;
      &lt;developer&gt;
          &lt;id&gt;lawson89&lt;/id&gt;
          &lt;name&gt;Richard Lawson&lt;/name&gt;
          &lt;email/&gt;
      &lt;/developer&gt;
      &lt;developer&gt;
          &lt;id&gt;dougmorato&lt;/id&gt;
          &lt;name&gt;Doug Morato&lt;/name&gt;
          &lt;email&gt;doug.morato@owasp.org&lt;/email&gt;
          &lt;organization&gt;OWASP&lt;/organization&gt;
          &lt;organizationUrl&gt;https://github.com/dougmorato&lt;/organizationUrl&gt;
          &lt;timezone&gt;America/New_York&lt;/timezone&gt;
          &lt;properties&gt;
              &lt;picUrl&gt;https://avatars2.githubusercontent.com/u/9654?v=3&amp;amp;s=150&lt;/picUrl&gt;
          &lt;/properties&gt;
      &lt;/developer&gt;
  &lt;/developers&gt;
  
  &lt;mailingLists&gt;
      &lt;mailingList&gt;
          &lt;name&gt;OWASP WebGoat Mailing List&lt;/name&gt;
          &lt;subscribe&gt;https://lists.owasp.org/mailman/listinfo/owasp-webgoat&lt;/subscribe&gt;
          &lt;unsubscribe&gt;Owasp-webgoat-request@lists.owasp.org&lt;/unsubscribe&gt;
          &lt;post&gt;owasp-webgoat@lists.owasp.org&lt;/post&gt;
          &lt;archive&gt;http://lists.owasp.org/pipermail/owasp-webgoat/&lt;/archive&gt;
      &lt;/mailingList&gt;
  &lt;/mailingLists&gt;
  
  &lt;scm&gt;
      &lt;url&gt;https://github.com/WebGoat/WebGoat&lt;/url&gt;
      &lt;connection&gt;scm:git:git@github.com:WebGoat/WebGoat.git&lt;/connection&gt;
      &lt;developerConnection&gt;scm:git:git@github.com:WebGoat/WebGoat.git&lt;/developerConnection&gt;
      &lt;tag&gt;HEAD&lt;/tag&gt;
  &lt;/scm&gt;
  
  &lt;issueManagement&gt;
      &lt;system&gt;Github Issues&lt;/system&gt;
      &lt;url&gt;https://github.com/WebGoat/WebGoat/issues&lt;/url&gt;
  &lt;/issueManagement&gt;
  
  &lt;ciManagement&gt;
      &lt;system&gt;Travis CI&lt;/system&gt;
      &lt;url&gt;https://travis-ci.org/WebGoat/WebGoat&lt;/url&gt;
  &lt;/ciManagement&gt;
  
  &lt;properties&gt;
      &lt;!-- Use UTF-8 Encoding --&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;maven.compiler.source&gt;11&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;11&lt;/maven.compiler.target&gt;
  
      &lt;!-- This build number will be ubdated by Travis-CI --&gt;
      &lt;build.number&gt;build&lt;/build.number&gt;
  
      &lt;!-- Shared properties with plugins and version numbers across submodules--&gt;
      &lt;activation.version&gt;1.1.1&lt;/activation.version&gt;
      &lt;commons-collections.version&gt;3.2.1&lt;/commons-collections.version&gt;
      &lt;commons-lang3.version&gt;3.4&lt;/commons-lang3.version&gt;
      &lt;commons-io.version&gt;2.6&lt;/commons-io.version&gt;
      &lt;guava.version&gt;30.1-jre&lt;/guava.version&gt;
      &lt;lombok.version&gt;1.18.4&lt;/lombok.version&gt;
      &lt;maven-compiler-plugin.version&gt;3.8.0&lt;/maven-compiler-plugin.version&gt;
      &lt;maven-failsafe-plugin.version&gt;2.22.0&lt;/maven-failsafe-plugin.version&gt;
      &lt;maven-jar-plugin.version&gt;3.1.2&lt;/maven-jar-plugin.version&gt;
      &lt;maven-javadoc-plugin.version&gt;3.1.1&lt;/maven-javadoc-plugin.version&gt;
      &lt;maven-source-plugin.version&gt;3.1.0&lt;/maven-source-plugin.version&gt;
      &lt;maven-surefire-plugin.version&gt;3.0.0-M4&lt;/maven-surefire-plugin.version&gt;
      &lt;revision&gt;8.2.0-SNAPSHOT&lt;/revision&gt;
  &lt;/properties&gt;
  
  &lt;modules&gt;
      &lt;module&gt;webgoat-container&lt;/module&gt;
      &lt;module&gt;webgoat-lessons&lt;/module&gt;
      &lt;module&gt;webgoat-server&lt;/module&gt;
      &lt;module&gt;webwolf&lt;/module&gt;
      &lt;module&gt;webgoat-integration-tests&lt;/module&gt;
      &lt;module&gt;docker&lt;/module&gt;&lt;!-- copy required jars in preparation of docker all-in-one build --&gt;
  &lt;/modules&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-validation&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
          &lt;artifactId&gt;lombok&lt;/artifactId&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
          &lt;optional&gt;true&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
          &lt;artifactId&gt;commons-exec&lt;/artifactId&gt;
          &lt;version&gt;1.3&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
          &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;flatten-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.2.5&lt;/version&gt;
              &lt;configuration&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;flatten&lt;/id&gt;
                      &lt;phase&gt;process-resources&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;flatten&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&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;configuration&gt;
                  &lt;source&gt;11&lt;/source&gt;
                  &lt;target&gt;11&lt;/target&gt;
                  &lt;encoding&gt;UTF-8&lt;/encoding&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-checkstyle-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.1.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                  &lt;consoleOutput&gt;true&lt;/consoleOutput&gt;
                  &lt;failsOnError&gt;true&lt;/failsOnError&gt;
                  &lt;configLocation&gt;config/checkstyle/checkstyle.xml&lt;/configLocation&gt;
                  &lt;suppressionsLocation&gt;config/checkstyle/suppressions.xml&lt;/suppressionsLocation&gt;
                  &lt;suppressionsFileExpression&gt;checkstyle.suppressions.file&lt;/suppressionsFileExpression&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-pmd-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.14.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;targetJdk&gt;11&lt;/targetJdk&gt;
                  &lt;failurePriority&gt;1&lt;/failurePriority&gt;&lt;!-- 5 means fail even on the lowest priority, 0 means never fail --&gt;
                  &lt;rulesets&gt;
                      &lt;!--suppress UnresolvedMavenProperty --&gt;
                      &lt;ruleset&gt;${maven.multiModuleProjectDirectory}/config/pmd/pmd-ruleset.xml&lt;/ruleset&gt;
                  &lt;/rulesets&gt;
                  &lt;failOnViolation&gt;true&lt;/failOnViolation&gt;
                  &lt;printFailingErrors&gt;true&lt;/printFailingErrors&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;check&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;owasp&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;build&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.owasp&lt;/groupId&gt;
                      &lt;artifactId&gt;dependency-check-maven&lt;/artifactId&gt;
                      &lt;version&gt;5.3.2&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;failBuildOnCVSS&gt;7&lt;/failBuildOnCVSS&gt;
                          &lt;skipProvidedScope&gt;true&lt;/skipProvidedScope&gt;
                          &lt;skipRuntimeScope&gt;true&lt;/skipRuntimeScope&gt;
                          &lt;suppressionFiles&gt;
                              &lt;!--suppress UnresolvedMavenProperty --&gt;
                              &lt;suppressionFile&gt;
                                  ${maven.multiModuleProjectDirectory}/config/dependency-check/project-suppression.xml
                              &lt;/suppressionFile&gt;
                          &lt;/suppressionFiles&gt;
                      &lt;/configuration&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;check&lt;/goal&gt;
                              &lt;/goals&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;central&lt;/id&gt;
          &lt;url&gt;https://repo.maven.apache.org/maven2&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;central&lt;/id&gt;
          &lt;url&gt;https://repo.maven.apache.org/maven2&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  </code></pre>
  
  <p>mvn -v output:</p>
  <pre><code>Maven home: /Users/tom/apache-maven-3.6.3
  Java version: 16, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-16.jdk/Contents/Home
  Default locale: en_US, platform encoding: UTF-8
  OS name: &quot;mac os x&quot;, version: &quot;10.15.7&quot;, arch: &quot;x86_64&quot;, family: &quot;mac&quot;
  </code></pre>
  <p>And my $JAVA_HOME is set to:</p>
  <pre><code>% echo $JAVA_HOME
  /Library/Java/JavaVirtualMachines/jdk-16.jdk/Contents/Home
  </code></pre>
  <p>I believe that there is an issue with Maven not knowing where my correct javac is, but I'm not sure what I need to edit/add in the pom.xml file to make sure that it does know. I verified that javac is version 16.</p>