You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Herve Boutemy (Jira)" <ji...@apache.org> on 2021/09/05 08:58:00 UTC
[jira] [Comment Edited] (MWAR-439) WAR Plugin 3.3.1 hits NPE when
exploding if maven session start time is null
[ https://issues.apache.org/jira/browse/MWAR-439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17410131#comment-17410131 ]
Herve Boutemy edited comment on MWAR-439 at 9/5/21, 8:57 AM:
-------------------------------------------------------------
no real need to dissect, git blame is sufficient :) : timestamp check was introduced in MWAR-433
added a check against this unexpected null value in https://github.com/apache/maven-war-plugin/commit/d78d6b563b7eb3b2f16b042eb3492e220ce83b26
of course, the root cause is the integration that does not set the startTime Date, but the plugin cannot fix anything, just protect itself against such unexpected state
was (Author: hboutemy):
no real need to dissect, git blame is sufficient :) : timestamp check was introduced in MWAR-433
added a check against this unexpected null value in https://github.com/apache/maven-war-plugin/commit/d78d6b563b7eb3b2f16b042eb3492e220ce83b26
> WAR Plugin 3.3.1 hits NPE when exploding if maven session start time is null
> ----------------------------------------------------------------------------
>
> Key: MWAR-439
> URL: https://issues.apache.org/jira/browse/MWAR-439
> Project: Maven WAR Plugin
> Issue Type: Bug
> Affects Versions: 3.3.1
> Environment: Windows 10
> Eclipse Version: 20200910-1200
> m2e Version: 1.16.1.20200710-1008
> Reporter: Ben DeLillo
> Priority: Major
> Fix For: 3.3.2
>
>
> 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:
> {code:java}
> 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) {code}
> The stack trace for this error is
> {code:java}
> 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{code}
> 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.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)