{"record":{"id":"5cfa662c42701817","repo":"quarkusio/quarkus","slug":"this-goal-requires-a-project","errorCode":null,"errorMessage":"This goal requires a project","messagePattern":"This goal requires a project","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/QuarkusProjectStateMojoBase.java","lineNumber":49,"sourceCode":"import io.quarkus.maven.components.QuarkusWorkspaceProvider;\nimport io.quarkus.maven.dependency.ArtifactCoords;\n\npublic abstract class QuarkusProjectStateMojoBase extends QuarkusProjectMojoBase {\n\n    @Component\n    QuarkusWorkspaceProvider workspaceProvider;\n\n    /**\n     * If true, the information will be logged per each relevant module of the project\n     * instead of an overall summary\n     */\n    @Parameter(property = \"perModule\", required = false)\n    boolean perModule;\n\n    @Override\n    public void doExecute(QuarkusProject quarkusProject, MessageWriter log) throws MojoExecutionException {\n        if (project.getFile() == null) {\n            throw new MojoExecutionException(\"This goal requires a project\");\n        }\n\n        if (!QuarkusProjectHelper.isRegistryClientEnabled()) {\n            throw new MojoExecutionException(\"This goal requires a Quarkus extension registry client to be enabled\");\n        }\n\n        final Collection<Path> createdDirs = ensureResolvable(new DefaultArtifact(project.getGroupId(),\n                project.getArtifactId(), ArtifactCoords.TYPE_POM, project.getVersion()));\n        try {\n            processProjectState(quarkusProject);\n        } finally {\n            for (Path p : createdDirs) {\n                IoUtils.recursiveDelete(p);\n            }\n        }\n    }\n\n    protected abstract void processProjectState(QuarkusProject quarkusProject) throws MojoExecutionException;","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/QuarkusProjectStateMojoBase.java#L31-L67","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["cd into the directory containing the Quarkus project's pom.xml before running the goal","Use mvn -f path/to/pom.xml <goal> to point Maven at the project explicitly","For multi-module builds, run the goal on the aggregator pom with the correct flags, or per module as intended"],"exampleFix":"// before\nmvn io.quarkus:quarkus-maven-plugin:update   (run from ~)\n// after\ncd my-quarkus-app && mvn io.quarkus:quarkus-maven-plugin:update","handlingStrategy":"validation","validationCode":"if (!new File(\"pom.xml\").exists()) {\n    throw new IllegalStateException(\"Run this goal from a directory containing a pom.xml\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify cwd contains pom.xml before running project-state goals","Use mvn -f <path>/pom.xml in scripts to make the target project explicit","In multi-module repos, document which module the goal must run against","Check IDE terminal cwd when invoking Maven goals"],"tags":["maven","project-setup","cli-usage"],"backgroundTag":"goal-requires-maven-project","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-15T02:17:10.978Z"}