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

Regression in 2.13.2: NPE in LocalProject during quarkus-maven-plugin:build when activating quarkus.bootstrap.workspace-discovery #28541

Closed
famod opened this issue Oct 12, 2022 · 3 comments · Fixed by #28542

Comments

@famod
Copy link
Member

famod commented Oct 12, 2022

Describe the bug

Updating from 2.13.1 to 2.13.2 results in:

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:2.13.2.Final:build (default) on project somecomp-server: Failed to build quarkus application: Failed to initialize Quarkus bootstrap Maven artifact resolver: Failed to load current project at /home/fmo/proj/someproj/somecomp/dev1/server/.flattened-pom.xml: Cannot invoke "java.io.File.toPath()" because the return value of "org.apache.maven.model.Model.getProjectDirectory()" is null -> [Help 1]
...
Caused by: java.lang.NullPointerException: Cannot invoke "java.io.File.toPath()" because the return value of "org.apache.maven.model.Model.getProjectDirectory()" is null
    at io.quarkus.bootstrap.resolver.maven.workspace.LocalProject.<init> (LocalProject.java:172)
    at io.quarkus.bootstrap.resolver.maven.workspace.WorkspaceLoader.loadAndCacheProject (WorkspaceLoader.java:143)
    at io.quarkus.bootstrap.resolver.maven.workspace.WorkspaceLoader.project (WorkspaceLoader.java:118)
    at io.quarkus.bootstrap.resolver.maven.workspace.WorkspaceLoader.loadProject (WorkspaceLoader.java:178)
    at io.quarkus.bootstrap.resolver.maven.workspace.WorkspaceLoader.load (WorkspaceLoader.java:230)
    at io.quarkus.bootstrap.resolver.maven.workspace.LocalProject.loadWorkspace (LocalProject.java:118)
    at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.resolveCurrentProject (BootstrapMavenContext.java:321)
    at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.<init> (BootstrapMavenContext.java:173)
    at io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver.<init> (MavenArtifactResolver.java:91)
    at io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver$Builder.build (MavenArtifactResolver.java:75)
    at io.quarkus.maven.QuarkusBootstrapProvider$QuarkusMavenAppBootstrap.artifactResolver (QuarkusBootstrapProvider.java:152)
    at io.quarkus.maven.QuarkusBootstrapProvider$QuarkusMavenAppBootstrap.doBootstrap (QuarkusBootstrapProvider.java:206)
    at io.quarkus.maven.QuarkusBootstrapProvider$QuarkusMavenAppBootstrap.bootstrapApplication (QuarkusBootstrapProvider.java:284)
    at io.quarkus.maven.QuarkusBootstrapProvider.bootstrapApplication (QuarkusBootstrapProvider.java:86)
    at io.quarkus.maven.QuarkusBootstrapMojo.bootstrapApplication (QuarkusBootstrapMojo.java:272)
    at io.quarkus.maven.QuarkusBootstrapMojo.bootstrapApplication (QuarkusBootstrapMojo.java:268)
    at io.quarkus.maven.BuildMojo.doExecute (BuildMojo.java:130)
    at io.quarkus.maven.QuarkusBootstrapMojo.execute (QuarkusBootstrapMojo.java:154)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
    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.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:539)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
    at java.lang.Thread.run (Thread.java:833)

Expected behavior

No error

Actual behavior

Error during build

How to Reproduce?

n/a at this point

Output of uname -a or ver

No response

Output of java -version

17.0.4

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

Maven 3.8.6

Additional information

Build happens via profile:

        <profile>
            <id>image-build</id>
            <properties>
                <!-- switch on early Quarkus workspace discovery for smaller layers -->
                <quarkus.bootstrap.workspace-discovery>true</quarkus.bootstrap.workspace-discovery>
                <quarkus.container-image.name>somecomp</quarkus.container-image.name>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.quarkus</groupId>
                        <artifactId>quarkus-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>build</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

Jib plugin is used to build the image (but it doesn't get that far).

@famod famod added the kind/bug Something isn't working label Oct 12, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 12, 2022

/cc @geoand, @quarkusio/devtools

@famod
Copy link
Member Author

famod commented Oct 12, 2022

@aloubyansky maybe some interference between #28419 and quarkus.bootstrap.workspace-discovery?

Edit: Problem vanishes when switching off quarkus.bootstrap.workspace-discovery.

@famod famod changed the title Regression in 2.13.2: NPE in LocalProject during quarkus-maven-plugin:build Regression in 2.13.2: NPE in LocalProject during quarkus-maven-plugin:build when activating quarkus.bootstrap.workspace-discovery Oct 12, 2022
@aloubyansky
Copy link
Member

Thanks @famod, I believe #28542 will fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants