Uploaded image for project: 'Maven WAR Plugin'
  1. Maven WAR Plugin
  2. MWAR-439

WAR Plugin 3.3.1 hits NPE when exploding if maven session start time is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.1
    • 3.3.2
    • None
    • None
    • Windows 10
      Eclipse Version: 20200910-1200
      m2e Version: 1.16.1.20200710-1008

    Description

      I don't have a distributable repro case, but I can say that in my multi-module project, when the exploded goal is invoked by eclipse and m2e the following error occurs:

      Execution default of goal org.apache.maven.plugins:maven-war-plugin:3.3.1:exploded failed. (org.apache.maven.plugins:maven-war-plugin:3.3.1:exploded:default:process-resources) 

      The stack trace for this error is

      org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.apache.maven.plugins:maven-war-plugin:3.3.1:exploded failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:148) at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:332) at org.eclipse.m2e.core.internal.embedder.MavenImpl.lambda$8(MavenImpl.java:1380) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:114) at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1379) at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:54) at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:135) at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:169) at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$1(MavenBuilder.java:114) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:114) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$0(MavenBuilder.java:105) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:88) at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:197) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:832) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392) at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:515) at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:405) at org.eclipse.ui.actions.GlobalBuildAction$1.run(GlobalBuildAction.java:180) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) Caused by: java.lang.NullPointerException at org.apache.maven.plugins.war.AbstractWarMojo$DefaultWarPackagingContext$1.visitFile(AbstractWarMojo.java:661) at org.apache.maven.plugins.war.AbstractWarMojo$DefaultWarPackagingContext$1.visitFile(AbstractWarMojo.java:656) at java.base/java.nio.file.Files.walkFileTree(Files.java:2804) at java.base/java.nio.file.Files.walkFileTree(Files.java:2876) at org.apache.maven.plugins.war.AbstractWarMojo$DefaultWarPackagingContext.<init>(AbstractWarMojo.java:655) at org.apache.maven.plugins.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:520) at org.apache.maven.plugins.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:453) at org.apache.maven.plugins.war.WarExplodedMojo.execute(WarExplodedMojo.java:43) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) ... 31 more pom.xml /my-legacy-app line 1753 Maven Build Problem

      I've debugged into AbstractWarMojo.visitFile, and on line 661 session.getStartTime() is null, so the call to getTime() throws an NPE. Attempting to track down why the start time is null led me to MavenImpl, at which point I've gotten a bit stuck trying to further track down the issue. I think it was pointing to something in MavenExecutionContext, but I'm not entirely sure.

      The check against getStartTime was introduced in 3.3.1 so switching to 3.3.0 unblocks me for now.

       

      Attachments

        Issue Links

          Activity

            People

              hboutemy Herve Boutemy
              Ben DeLillo Ben DeLillo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: