quarkusio/quarkus · error · MojoExecutionException
Unable to add extensions
Error message
Unable to add extensions
What it means
AddExtensionMojo.doExecute throws this when the AddExtensions QuarkusCommandOutcome reports failure — the command ran but could not add the requested extensions (e.g. unknown extension artifact IDs). It is the failure branch distinct from the exception path which produces 'Unable to update the pom.xml file'.
Source
Thrown at devtools/maven/src/main/java/io/quarkus/maven/AddExtensionMojo.java:65
@Override
public void doExecute(final QuarkusProject quarkusProject, final MessageWriter log)
throws MojoExecutionException {
Set<String> ext = new HashSet<>();
if (extensions != null && !extensions.isEmpty()) {
ext.addAll(extensions);
} else {
// Parse the "extension" just in case it contains several comma-separated values
// https://github.com/quarkusio/quarkus/issues/2393
ext.addAll(Arrays.stream(extension.split(",")).map(String::trim).collect(toSet()));
}
try {
AddExtensions addExtensions = new AddExtensions(quarkusProject)
.extensions(ext.stream().map(String::trim).collect(toSet()));
final QuarkusCommandOutcome outcome = addExtensions.execute();
if (!outcome.isSuccess()) {
throw new MojoExecutionException("Unable to add extensions");
}
} catch (Exception e) {
throw new MojoExecutionException("Unable to update the pom.xml file", e);
}
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Verify extension artifactIds with `mvn quarkus:list-extensions` and correct typos.
- Check the full log output above the error for which extension failed.
- Ensure network access to the extension registry and correct quarkus platform/BOM version.
Example fix
// before mvn quarkus:add-extension -Dextensions=postgres // after mvn quarkus:add-extension -Dextensions=quarkus-jdbc-postgresql
Defensive patterns
Strategy: validation
Validate before calling
mvn quarkus:list-extensions | grep -i <artifactId> # verify the extension exists before adding
Try / catch
try { ... } catch (MojoExecutionException e) { log.error('Extension add failed: check artifactIds with quarkus:list-extensions'); } Prevention
- Always confirm artifactIds via quarkus:list-extensions.
- Use full artifactIds (quarkus-*) rather than guesses.
- Keep the Quarkus platform BOM current.
When it happens
Trigger: addExtensions.execute() returns outcome.isSuccess() == false, typically because one or more extension artifactIds were not found in the registry/catalog.
Common situations: Misspelled or wrong extension artifactId (e.g. 'postgres' instead of 'quarkus-jdbc-postgresql'); offline environment where the registry cannot be queried; project not recognized as a Quarkus project.
Related errors
- Failed to initialize Maven artifact resolver
- You are trying to create a Maven project in a directory that
- You are trying to create gradle Project in a directory that
- The project was created but (some of) the requested extensio
- Failed to list extensions
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/b726f5266a4e228b.
Report an issue: GitHub.