Skip to content

Quarkus code generation phase has failed: Cannot invoke "java.io.File.toPath()" because the return value of "org.apache.maven.project.MavenProject.getFile()" is null #52863

@metacosm

Description

@metacosm

Describe the bug

We build natively a subset of our project on CI using the following command:
./mvnw -B install -DskipDocs -Dnative --file pom.xml -P'<maven profiles>' -pl '<list of modules>'
from the root of our repo.
This used to work just fine but has started failing within the last week or so (can't pinpoint the exact time because we had other unrelated failures around the same time) with the error:
Quarkus code generation phase has failed: Cannot invoke "java.io.File.toPath()" because the return value of "org.apache.maven.project.MavenProject.getFile()" is null

Note that performing the native build directly in the module where this is failing works just fine and it also doesn't fail for all the submodules. This seems related to the use of the quarkus packaging as it looks like only the modules using that packaging are failing.

Expected behavior

Should be able to build natively as previously.

Actual behavior

Build failure. Latest CI run exhibiting the issue: https://github.com/quarkiverse/quarkus-operator-sdk/actions/runs/22604503617/job/65493521758#step:26:861

How to Reproduce?

  • Check out project: quarkiverse/quarkus-operator-sdk
  • Change the Quarkus version to 999-SNAPSHOT
  • Perform a quick build: mvn -Dquickly -Puse-snapshots -T1C
  • Perform native build: ``./mvnw -B install -DskipDocs -Dnative --file pom.xml -P'use-snapshots' -pl 'samples/exposedapp'`

Output of uname -a or ver

Probably irrelevant as it happens on multiple OSes

Output of java -version

Probably irrelevant as it happens with multiple Java versions (tested 17, 21 & 25)

Mandrel or GraalVM version (if different from Java)

The error happens before the native build is actually triggered

Quarkus version or git rev

999-SNAPSHOT

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

Maven home: /.m2/wrapper/dists/apache-maven-3.9.8/af622e91
Java version: 21, vendor: Eclipse Adoptium, runtime: /opt/homebrew/Cellar/sdkman-cli/5.19.0/libexec/candidates/java/21-tem
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "26.3", arch: "aarch64", family: "mac"

Additional information

This looks like a maven plugin issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions