Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException: Cannot invoke "org.apache.maven.lifecycle.internal.ReactorBuildStatus.isHalted()" because "status" is null #795

Closed
famod opened this issue Feb 16, 2023 · 2 comments

Comments

@famod
Copy link
Contributor

famod commented Feb 16, 2023

While trying to migrate my Quarkus app to 3.0.0.alpha4 via

curl -Ls https://sh.jbang.dev | bash -s - --fresh upgrade-to-quarkus3@quarkusio

I'm receiving an error from OpenRewrite and also a subsequent error related to mvnd (at the bottom):

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.588 s
[INFO] Finished at: 2023-02-16T15:43:05+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openrewrite.maven:rewrite-maven-plugin:4.39.0:run (default-cli) on project register-archive-server: Execution default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:4.39.0:run failed: Illegal character in path at index 81: file:///home/famod/.m2/repository/somecompany/someproj/register-archive-parent/${revision}.${changelist}-dev3/register-archive-parent-${revision}.${changelist}-dev3.pom -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.openrewrite.maven:rewrite-maven-plugin:4.39.0:run (default-cli) on project register-archive-server: Execution default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:4.39.0:run failed: Illegal character in path at index 81: file:///home/famod/.m2/repository/somecompany/someproj/register-archive-parent/${revision}.${changelist}-dev3/register-archive-parent-${revision}.${changelist}-dev3.pom
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:375)
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:351)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:215)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:171)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:163)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:210)
	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:195)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:4.39.0:run failed: Illegal character in path at index 81: file:///home/famod/.m2/repository/somecompany/someproj/register-archive-parent/${revision}.${changelist}-dev3/register-archive-parent-${revision}.${changelist}-dev3.pom
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:148)
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:370)
	... 13 common frames omitted
Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 81: file:///home/famod/.m2/repository/somecompany/someproj/register-archive-parent/${revision}.${changelist}-dev3/register-archive-parent-${revision}.${changelist}-dev3.pom
	at java.base/java.net.URI.create(URI.java:906)
	at org.openrewrite.maven.internal.MavenPomDownloader.download(MavenPomDownloader.java:487)
	at org.openrewrite.maven.tree.ResolvedPom$Resolver.resolveParentPropertiesAndRepositoriesRecursively(ResolvedPom.java:353)
	at org.openrewrite.maven.tree.ResolvedPom$Resolver.resolveParentsRecursively(ResolvedPom.java:310)
	at org.openrewrite.maven.tree.ResolvedPom$Resolver.resolve(ResolvedPom.java:299)
	at org.openrewrite.maven.tree.ResolvedPom.resolve(ResolvedPom.java:144)
	at org.openrewrite.maven.tree.Pom.resolve(Pom.java:104)
	at org.openrewrite.maven.MavenParser.parseInputs(MavenParser.java:122)
	at org.openrewrite.Parser.parse(Parser.java:41)
	at org.openrewrite.maven.MavenMojoProjectParser.parseMaven(MavenMojoProjectParser.java:309)
	at org.openrewrite.maven.MavenMojoProjectParser.listSourceFiles(MavenMojoProjectParser.java:119)
	at org.openrewrite.maven.AbstractRewriteMojo.listResults(AbstractRewriteMojo.java:253)
	at org.openrewrite.maven.AbstractRewriteRunMojo.execute(AbstractRewriteRunMojo.java:48)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	... 14 common frames omitted
Caused by: java.net.URISyntaxException: Illegal character in path at index 81: file:///home/famod/.m2/repository/somecompany/someproj/register-archive-parent/${revision}.${changelist}-dev3/register-archive-parent-${revision}.${changelist}-dev3.pom
	at java.base/java.net.URI$Parser.fail(URI.java:2974)
	at java.base/java.net.URI$Parser.checkChars(URI.java:3145)
	at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3227)
	at java.base/java.net.URI$Parser.parse(URI.java:3175)
	at java.base/java.net.URI.<init>(URI.java:623)
	at java.base/java.net.URI.create(URI.java:904)
	... 27 common frames omitted
[ERROR] java.lang.NullPointerException: Cannot invoke "org.apache.maven.lifecycle.internal.ReactorBuildStatus.isHalted()" because "status" is null

java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.apache.maven.lifecycle.internal.ReactorBuildStatus.isHalted()" because "status" is null
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder.multiThreadedProjectTaskSegmentBuild(MultiThreadedBuilder.java:151)
	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder.build(MultiThreadedBuilder.java:105)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:298)
	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:960)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:293)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:196)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/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: java.lang.NullPointerException: Cannot invoke "org.apache.maven.lifecycle.internal.ReactorBuildStatus.isHalted()" because "status" is null
	at org.mvndaemon.mvnd.logging.smart.LoggingExecutionListener.afterProjectExecutionFailure(LoggingExecutionListener.java:66)
	at org.apache.maven.lifecycle.internal.CompoundProjectExecutionListener.afterProjectExecutionFailure(CompoundProjectExecutionListener.java:69)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:133)
	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:210)
	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:195)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

The crucial bit is at org.mvndaemon.mvnd.logging.smart.LoggingExecutionListener.afterProjectExecutionFailure(LoggingExecutionListener.java:66).

To be clear, the initial OpenRewrite error is not the fault of mvnd.

Btw, it's totally unexpected that anything related to mvnd is involved here because that migrate script does not call mvnd but mvn instead.
Turns out that the mvnd and maven sdkman packages are overlapping, which I will create another issue for (edit: already exists: #787).
I had mvnd sdkman package version 0.9.0 installed at this point.

@gnodet
Copy link
Contributor

gnodet commented Mar 9, 2023

I'm still hesitant about fixing #787. Problems go away as soon as mvnd is considered a different distribution of maven from a sdkman pov. You can then easily switch between mvn / mvnd in which ever version you want.

@famod
Copy link
Contributor Author

famod commented Mar 9, 2023

However #787 pans out in the end, my main point here is that NPE (as a follow up error of some other issue).

gnodet added a commit to gnodet/mvnd that referenced this issue Mar 9, 2023
gnodet added a commit to gnodet/mvnd that referenced this issue Mar 9, 2023
@gnodet gnodet closed this as completed in 2113d61 Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants