title: Java 17: Maven doesn't give much information about the error that happened, why?
body: <p>I'm upgrading from JDK 8 to JDK 17 and I'm trying to compile with <code>mvn clean install -X -DskipTests</code> and there's no information about the error.</p>
  <p>Btw, I'm updating the dependencies and after that I compile to see if has errors. I need to update some dependencies such as Spring, Hibernate etc. I already updated Lombok.</p>
  <p>I added the -X or -e option but I got the same result.</p>
  <p>What can I do to get more information about the error? The log shows that it was loading hibernate-jpa-2.1-api before failed... so that means the problem is in this dependency?</p>
  <pre><code>[INFO] [loading /Users/daniela/.m2/repository/org/projectlombok/lombok/1.18.2/lombok-1.18.2.jar(/lombok/AllArgsConstructor$AnyAnnotation.class)]
  [INFO] [loading /Users/daniela/.m2/repository/org/ocpsoft/rewrite/rewrite-config-prettyfaces/2.0.4.Final/rewrite-config-prettyfaces-2.0.4.Final.jar(/com/ocpsoft/pretty/faces/annotation/URLValidator.class)]
  [INFO] [loading /Users/daniela/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar(/javax/servlet/annotation/WebInitParam.class)]
  [INFO] [loading /Users/daniela/.m2/repository/org/projectlombok/lombok/1.18.2/lombok-1.18.2.jar(/lombok/RequiredArgsConstructor$AnyAnnotation.class)]
  [INFO] [loading /Users/daniela/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.0.Final/hibernate-jpa-2.1-api-1.0.0.Final.jar(/javax/persistence/PersistenceProperty.class)]
  [INFO] ------------------------------------------------------------------------
  [INFO] Reactor Summary for My App 2.61.0-SNAPSHOT:
  [INFO] 
  [INFO] My App ............................. SUCCESS [  0.005 s]
  [INFO] My App - Webapp .................... FAILURE [  9.454 s]
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time:  9.555 s
  [INFO] Finished at: 2021-09-21T10:31:24-03:00
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project myapp-webapp: Compilation failure -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project myapp-webapp: Compilation failure
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
      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:56)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:568)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
  Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
      at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1224)
      at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:187)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
      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:56)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:568)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
  [ERROR] 
  [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
  [ERROR] 
  [ERROR] After correcting the problems, you can resume the build with the command
  [ERROR]   mvn &lt;args&gt; -rf :myapp-webapp
  </code></pre>
  <p>pom.xml (Parent)</p>
  <pre><code>&lt;properties&gt;
  
          &lt;!-- Generic properties --&gt;
          &lt;java.version&gt;17&lt;/java.version&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 EE / Java SE dependencies --&gt;
          &lt;jsp.version&gt;2.2&lt;/jsp.version&gt;
          &lt;jstl.version&gt;1.2&lt;/jstl.version&gt;
          &lt;servlet.version&gt;3.1.0&lt;/servlet.version&gt;
          &lt;javax-el.version&gt;3.0.0&lt;/javax-el.version&gt;
          &lt;jaxb-impl.version&gt;2.2.7-b63&lt;/jaxb-impl.version&gt;
  
          &lt;!-- Other dependencies such as Spring, Hibernate etc --&gt;
  
          &lt;maven.compiler.source&gt;17&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;17&lt;/maven.compiler.target&gt;
  &lt;/properties&gt;
  
  &lt;build&gt;
  
          &lt;pluginManagement&gt;
  
              &lt;plugins&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.8.1&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;annotationProcessorPaths&gt;
                              &lt;path&gt;
                                  &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
                                  &lt;artifactId&gt;lombok&lt;/artifactId&gt;
                                  &lt;version&gt;${lombok.version}&lt;/version&gt;
                              &lt;/path&gt;
                          &lt;/annotationProcessorPaths&gt;
                          &lt;compilerArguments&gt;
                              &lt;verbose /&gt;
                              &lt;Xlint /&gt;
                          &lt;/compilerArguments&gt;
                          &lt;fork&gt;true&lt;/fork&gt;
                          &lt;verbose&gt;true&lt;/verbose&gt;
                          &lt;source&gt;17&lt;/source&gt;
                          &lt;target&gt;17&lt;/target&gt;
                          &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                          &lt;compilerVersion&gt;17&lt;/compilerVersion&gt;
                          &lt;debug&gt;true&lt;/debug&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
  
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.4&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;warName&gt;${project.build.finalName}&lt;/warName&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
  
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.5&lt;/version&gt;
                      &lt;dependencies&gt;
                          &lt;dependency&gt;
                              &lt;groupId&gt;org.apache.maven.scm&lt;/groupId&gt;
                              &lt;artifactId&gt;maven-scm-provider-gitexe&lt;/artifactId&gt;
                              &lt;version&gt;1.9.2&lt;/version&gt;
                          &lt;/dependency&gt;
                      &lt;/dependencies&gt;
                      &lt;configuration&gt;
                          &lt;arguments&gt;-Dbuild-env=${build-env}&lt;/arguments&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
  
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.9&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;skip&gt;true&lt;/skip&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
  
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.6.1&lt;/version&gt;
                  &lt;/plugin&gt;
  
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.7&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;id&gt;copy-resources&lt;/id&gt;
                              &lt;phase&gt;validate&lt;/phase&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;copy-resources&lt;/goal&gt;
                              &lt;/goals&gt;
                              &lt;configuration&gt;
                                  &lt;outputDirectory&gt;${project.build.outputDirectory}/com/my/app/bundle&lt;/outputDirectory&gt;
                                  &lt;resources&gt;
                                      &lt;resource&gt;
                                          &lt;directory&gt;src/main/resources/my/app/bundle&lt;/directory&gt;
                                          &lt;filtering&gt;true&lt;/filtering&gt;
                                      &lt;/resource&gt;
                                  &lt;/resources&gt;
                              &lt;/configuration&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-site-plugin&lt;/artifactId&gt;
                          &lt;version&gt;3.9.1&lt;/version&gt;
                  &lt;/plugin&gt;
  
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-project-info-reports-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.1.2&lt;/version&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
  
          &lt;/pluginManagement&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
  
          &lt;/plugins&gt;
  
      &lt;/build&gt;
  </code></pre>
  <p>pom.xml (Child)</p>
  <pre><code>&lt;properties&gt;
          &lt;java.version&gt;17&lt;/java.version&gt;
  
          &lt;maven.compiler.source&gt;17&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;17&lt;/maven.compiler.target&gt;
  &lt;/properties&gt;
  
  &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;dev&lt;/id&gt;
              &lt;activation&gt;
                  &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;/activation&gt;
  
              &lt;build&gt;
                  &lt;finalName&gt;myapp&lt;/finalName&gt;
                  &lt;plugins&gt;
  
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                      &lt;/plugin&gt;
  
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                          &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                          &lt;configuration&gt;
                              &lt;includes&gt;
                                  &lt;include&gt;**/*IT.java&lt;/include&gt;
                              &lt;/includes&gt;
                          &lt;/configuration&gt;
                          &lt;version&gt;2.18.1&lt;/version&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;inherited&gt;true&lt;/inherited&gt;
                      &lt;/plugin&gt;
  
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                          &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
                      &lt;/plugin&gt;
                      &lt;plugin&gt;
                          &lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
                      &lt;/plugin&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                          &lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt;
                      &lt;/plugin&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                          &lt;artifactId&gt;maven-project-info-reports-plugin&lt;/artifactId&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/build&gt;
          &lt;/profile&gt;
  &lt;/profile&gt;      
  </code></pre>
  <p>Java and mvn version</p>
  <pre><code>daniela@Danielas-Macbook ~&gt; javac -version
  javac 17
  daniela@Danielas-Macbook ~&gt; mvn --version
  Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
  Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
  Java version: 17
  </code></pre>
  <p>I changed the java version in maven to execute with JDK 8 and JDK 11 and there's no error: BUILD SUCCESS. I got the error in JDK 16 and 17.</p>