Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1465

Building with Maven 3.5.2 and Java 10 EA+38 gives an NPE

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.20.1
    • Fix Version/s: None
    • Component/s: Maven Surefire Plugin
    • Labels:
      None
    • Environment:

      Description

      Building with Maven 3.5.2 and Java 10 EA+38 gives an NPE:

      The build output below is from Apache HttpClient 5.0 BETA 1.

      The problems is an old version of Apache Commons Lang being shaded in the plugin. The POM shows version 3.5. The current version is 3.7 and this NPE was fixed in 3.7 by LANG-1365

      Note that Commons Lang 3.7 requires Java 7.

       

      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Summary:
      [INFO]
      [INFO] Apache HttpComponents Client Parent ................ SUCCESS [  5.829 s]
      [INFO] Apache HttpClient .................................. FAILURE [ 21.043 s]
      [INFO] Apache HttpClient Fluent ........................... SKIPPED
      [INFO] Apache HttpClient Cache ............................ SKIPPED
      [INFO] Apache HttpClient Windows features ................. SKIPPED
      [INFO] Apache HttpClient Integration Tests ................ SKIPPED
      [INFO] Apache HttpClient OSGi bundle ...................... SKIPPED
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 28.325 s
      [INFO] Finished at: 2018-01-17T10:19:24-07:00
      [INFO] Final Memory: 33M/117M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project httpclient5: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test failed.: NullPointerException -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project httpclient5: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test failed.
          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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:564)
          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.PluginExecutionException: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test failed.
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:145)
          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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:564)
          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: java.lang.NullPointerException
          at org.apache.maven.surefire.shade.org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast (SystemUtils.java:1626)
          at org.apache.maven.plugin.surefire.AbstractSurefireMojo.createSurefireBootDirectoryInTemp (AbstractSurefireMojo.java:2904)
          at org.apache.maven.plugin.surefire.AbstractSurefireMojo.getSurefireTempDir (AbstractSurefireMojo.java:2129)
          at org.apache.maven.plugin.surefire.AbstractSurefireMojo.getForkConfiguration (AbstractSurefireMojo.java:1967)
          at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider (AbstractSurefireMojo.java:1111)
          at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked (AbstractSurefireMojo.java:954)
          at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute (AbstractSurefireMojo.java:832)
          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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:564)
          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/PluginExecutionException
      [ERROR]
      [ERROR] After correcting the problems, you can resume the build with the command
      [ERROR]   mvn <goals> -rf :httpclient5
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tibordigana Tibor Digana
                Reporter:
                ggregory Gary Gregory
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: