{"record":{"id":"c69ee42aa5cad203","repo":"quarkusio/quarkus","slug":"unable-to-remove-extensions","errorCode":null,"errorMessage":"Unable to remove extensions","messagePattern":"Unable to remove extensions","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/RemoveExtensionMojo.java","lineNumber":64,"sourceCode":"\n    @Override\n    public void doExecute(final QuarkusProject quarkusProject, final MessageWriter log) throws MojoExecutionException {\n\n        Set<String> ext = new HashSet<>();\n        if (extensions != null && !extensions.isEmpty()) {\n            ext.addAll(extensions);\n        } else {\n            // Parse the \"extension\" just in case it contains several comma-separated values\n            // https://github.com/quarkusio/quarkus/issues/2393\n            ext.addAll(Arrays.stream(extension.split(\",\")).map(s -> s.trim()).collect(Collectors.toSet()));\n        }\n\n        try {\n            final QuarkusCommandOutcome outcome = new RemoveExtensions(quarkusProject)\n                    .extensions(ext.stream().map(String::trim).collect(Collectors.toSet()))\n                    .execute();\n            if (!outcome.isSuccess()) {\n                throw new MojoExecutionException(\"Unable to remove extensions\");\n            }\n        } catch (Exception e) {\n            throw new MojoExecutionException(\"Unable to update the pom.xml file\", e);\n        }\n    }\n}\n","sourceCodeStart":46,"sourceCodeEnd":71,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/RemoveExtensionMojo.java#L46-L71","documentation":"RemoveExtensionMojo (mvn quarkus:remove-extension) throws this MojoExecutionException when the underlying RemoveExtensions command reports a non-success outcome. It means the Quarkus command framework refused to remove the requested extensions from the project (e.g. the extension is not a registered dependency, or the pom rewrite was not performed). Note the separate catch block rethrows a different message, so this specific error surfaces only when the command executed but returned isSuccess()==false.","triggerScenarios":"Running `mvn quarkus:remove-extension -Dextensions=<list>` where ext names do not match installed extensions, or RemoveExtensions.execute() fails to modify the pom (e.g. the project has no Quarkus platform/BOM configured, or the extension is brought in transitively and cannot be removed directly).","commonSituations":"Typo in the extension artifactId; trying to remove an extension pulled in transitively by another dependency; removing the last platform dependency; running the goal in a project without a quarkus-maven-plugin-compatible pom setup.","solutions":["Verify the exact artifactId with `mvn quarkus:list-extensions` and retry with matching names","Check the pom.xml: the extension must be a direct dependency to be removable; remove the transitive source instead","Ensure the project has a Quarkus platform BOM/import configured","Run with -X / -e to see the underlying cause logged by the command"],"exampleFix":"// before\nmvn quarkus:remove-extension -Dextensions=quarkus-hibernate-ormn\n// after\nmvn quarkus:list-extensions   # confirm exact name\nmvn quarkus:remove-extension -Dextensions=quarkus-hibernate-orm","handlingStrategy":"validation","validationCode":"// Before running the mojo, verify each extension is a direct dependency:\nmvn quarkus:list-extensions | grep '<extension>'\n// or programmatically:\nboolean isDirect = project.getDependencies().stream()\n    .anyMatch(d -> d.getGroupId().equals(\"io.quarkus\") && d.getArtifactId().equals(ext));","typeGuard":null,"tryCatchPattern":"try { outcome = new RemoveExtensions(quarkusProject).extensions(names).execute();\n  if (!outcome.isSuccess()) { log.warn(\"Removal refused: check that extensions are direct dependencies\"); } }\ncatch (MojoExecutionException e) { log.error(\"remove-extension failed: {}\", e.getMessage(), e); }","preventionTips":["Run `mvn quarkus:list-extensions` first and copy names exactly","Only remove direct dependencies; remove transitive ones at their source","Keep a platform BOM import in the pom so the command can operate","Commit the pom before removal so a bad rewrite can be reverted with git checkout"],"tags":["maven","quarkus","build-tool"],"backgroundTag":"extension-removal-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}