quarkusio/quarkus · error · QuarkusCommandException
Failed to create project because of invalid extensions
Error message
Failed to create project because of invalid extensions
What it means
CreateJBangProjectCommandHandler.execute throws QuarkusCommandException('Failed to create project because of invalid extensions') when computeCoordsFromQuery returns null, meaning one or more extension keywords in the query could not be resolved to artifact coordinates.
Source
Thrown at independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateJBangProjectCommandHandler.java:33
import io.quarkus.devtools.codestarts.jbang.QuarkusJBangCodestartProjectInput;
import io.quarkus.devtools.codestarts.jbang.QuarkusJBangCodestartProjectInputBuilder;
import io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartData.QuarkusDataKey;
import io.quarkus.devtools.commands.CreateProject.CreateProjectKey;
import io.quarkus.devtools.commands.data.QuarkusCommandException;
import io.quarkus.devtools.commands.data.QuarkusCommandInvocation;
import io.quarkus.devtools.commands.data.QuarkusCommandOutcome;
import io.quarkus.devtools.messagewriter.MessageIcons;
import io.quarkus.devtools.project.QuarkusProject;
import io.quarkus.maven.dependency.ArtifactCoords;
import io.quarkus.registry.catalog.ExtensionCatalog;
public class CreateJBangProjectCommandHandler implements QuarkusCommandHandler {
@Override
public QuarkusCommandOutcome execute(QuarkusCommandInvocation invocation) throws QuarkusCommandException {
final Set<String> extensionsQuery = invocation.getValue(CreateProjectKey.EXTENSIONS, Collections.emptySet());
final List<ArtifactCoords> extensionsToAdd = computeCoordsFromQuery(invocation, extensionsQuery);
if (extensionsToAdd == null) {
throw new QuarkusCommandException("Failed to create project because of invalid extensions");
}
final ExtensionCatalog catalog = invocation.getExtensionsCatalog();
final boolean noWrapper = invocation.getValue(NO_JBANG_WRAPPER, false) ||
invocation.getValue(CreateProjectKey.NO_BUILDTOOL_WRAPPER, false);
final QuarkusJBangCodestartProjectInputBuilder builder = QuarkusJBangCodestartProjectInput.builder()
.addExtensions(extensionsToAdd)
.setNoJBangWrapper(noWrapper)
.addData(toCodestartData(invocation.getValues()))
.putData(QuarkusDataKey.QUARKUS_VERSION, invocation.getExtensionsCatalog().getQuarkusCoreVersion());
if (catalog.getBom() != null) {
// TODO properly import the BOMs
final ArtifactCoords firstBom = catalog.getBom();
builder.putData(QuarkusJBangCodestartCatalog.JBangDataKey.QUARKUS_BOM_GROUP_ID.key(),
firstBom.getGroupId())View on GitHub (pinned to e1c734241f)
Solutions
- Fix the -x/--extension arguments to exact names or full GAVs
- List available extensions to verify names (quarkus list extensions)
- Use wildcards only where a single match results or patterns are allowed
- Check the configured Quarkus platform version actually contains the extensions
Example fix
// before quarkus create jbang -x rest myapp // after quarkus create jbang -x quarkus-rest myapp
Defensive patterns
Strategy: validation
Validate before calling
for (String q : extensionsQuery) {
long n = catalog.getExtensions().stream().filter(e -> e.getArtifact().getArtifactId().equals(q)).count();
if (n != 1) throw new IllegalArgumentException("Extension keyword '" + q + "' resolves to " + n + " extensions");
} Type guard
static boolean resolvesUniquely(String keyword, ExtensionCatalog catalog) {
return catalog.getExtensions().stream()
.filter(e -> e.getArtifact().getArtifactId().equals(keyword)).count() == 1;
} Try / catch
try { handler.execute(invocation); } catch (QuarkusCommandException e) { /* message indicates invalid extensions; fix -x args */ } Prevention
- Use exact artifact ids or full GAVs in -x flags
- Validate extension names against the target platform version
- Keep CLI and platform versions aligned
- Test create commands in scripts with exact names
When it happens
Trigger: Creating a JBang project ('quarkus create ... -x <ext>') with extension keywords that match nothing or are ambiguous, so computeCoordsFromQuery signals failure via null.
Common situations: Misspelled extension names; generic keywords matching multiple extensions; extensions not present in the configured platform/registry version.
Related errors
- Multiple extensions found for keyword (no message; handled a
- Failed to create project because of invalid extensions
- %s is marked @Record but does not inject an @Recorder object
- Unknown recorder constructor parameter: %s in recorder %s
- capabilityErrors.report()
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/f35cdc8c85cb24b1.
Report an issue: GitHub.