quarkusio/quarkus · error · MojoExecutionException

This goal requires a project

Error message

This goal requires a project

What it means

This MojoExecutionException is thrown by QuarkusProjectStateMojoBase.doExecute (base for project-state goals like quarkus:update, quarkus:info) when the Maven project has no pom.xml file, i.e. the goal was invoked outside a valid Maven project. These goals operate on an existing Quarkus project and cannot proceed without one.

Source

Thrown at devtools/maven/src/main/java/io/quarkus/maven/QuarkusProjectStateMojoBase.java:49

import io.quarkus.maven.components.QuarkusWorkspaceProvider;
import io.quarkus.maven.dependency.ArtifactCoords;

public abstract class QuarkusProjectStateMojoBase extends QuarkusProjectMojoBase {

    @Component
    QuarkusWorkspaceProvider workspaceProvider;

    /**
     * If true, the information will be logged per each relevant module of the project
     * instead of an overall summary
     */
    @Parameter(property = "perModule", required = false)
    boolean perModule;

    @Override
    public void doExecute(QuarkusProject quarkusProject, MessageWriter log) throws MojoExecutionException {
        if (project.getFile() == null) {
            throw new MojoExecutionException("This goal requires a project");
        }

        if (!QuarkusProjectHelper.isRegistryClientEnabled()) {
            throw new MojoExecutionException("This goal requires a Quarkus extension registry client to be enabled");
        }

        final Collection<Path> createdDirs = ensureResolvable(new DefaultArtifact(project.getGroupId(),
                project.getArtifactId(), ArtifactCoords.TYPE_POM, project.getVersion()));
        try {
            processProjectState(quarkusProject);
        } finally {
            for (Path p : createdDirs) {
                IoUtils.recursiveDelete(p);
            }
        }
    }

    protected abstract void processProjectState(QuarkusProject quarkusProject) throws MojoExecutionException;

View on GitHub (pinned to e1c734241f)

Solutions

  1. cd into the directory containing the Quarkus project's pom.xml before running the goal
  2. Use mvn -f path/to/pom.xml <goal> to point Maven at the project explicitly
  3. For multi-module builds, run the goal on the aggregator pom with the correct flags, or per module as intended

Example fix

// before
mvn io.quarkus:quarkus-maven-plugin:update   (run from ~)
// after
cd my-quarkus-app && mvn io.quarkus:quarkus-maven-plugin:update
Defensive patterns

Strategy: validation

Validate before calling

if (!new File("pom.xml").exists()) {
    throw new IllegalStateException("Run this goal from a directory containing a pom.xml");
}

Prevention

When it happens

Trigger: Running mvn io.quarkus:quarkus-maven-plugin:update (or info, etc.) from a directory without a pom.xml, or with -f pointing at a non-existent/empty project.

Common situations: Running the goal in the home directory or repo root of a multi-module build without -f; typo in -f path; running from an IDE terminal whose cwd is wrong.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/5cfa662c42701817. Report an issue: GitHub.