quarkusio/quarkus · error · IllegalArgumentException
Extension ${extension} was configured to provide a capabilit
Error message
Extension ${extension} was configured to provide a capability with an empty name: ${providesStr} What it means
CapabilityContract.of() parses the comma-separated 'provides' capability list of an extension and rejects any empty capability name. Extensions must declare non-empty capability identifiers, so an empty name is treated as invalid extension metadata (IllegalArgumentException).
Source
Thrown at independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/CapabilityContract.java:33
/**
* @deprecated in favor of {@link #of(String, String, String)}
*
* @param extension extension id
* @param commaSeparatedList provided capabilities as a command-separated string
* @return capability contract
*/
@Deprecated(forRemoval = true)
public static CapabilityContract providesCapabilities(String extension, String commaSeparatedList) {
return of(extension, commaSeparatedList, null);
}
public static CapabilityContract of(String extension, String providesStr, String requiresStr) {
final Collection<String> provides = parseCapabilities(providesStr);
for (String name : provides) {
if (name.isEmpty()) {
throw new IllegalArgumentException("Extension " + extension
+ " was configured to provide a capability with an empty name: " + providesStr);
}
}
final Collection<String> requires = parseCapabilities(requiresStr);
for (String name : requires) {
if (name.isEmpty()) {
throw new IllegalArgumentException("Extension " + extension
+ " was configured to require a capability with an empty name: " + requiresStr);
}
}
return new CapabilityContract(extension, provides, requires);
}
private static Collection<String> parseCapabilities(String s) {
return s == null || s.isBlank() ? List.of() : Arrays.asList(capabilitiesPattern.split(s));
}
View on GitHub (pinned to e1c734241f)
Solutions
- Fix the provides string: remove empty segments and trailing commas (e.g. 'a,b' not 'a,b,').
- Trim and filter entries before calling of().
- Check the offending extension's capability declarations in its build configuration.
Example fix
// before
CapabilityContract.of("my-ext", "io.quarkus.rest,,io.quarkus.jpa", "");
// after
CapabilityContract.of("my-ext", "io.quarkus.rest,io.quarkus.jpa", ""); Defensive patterns
Strategy: validation
Validate before calling
boolean valid = Arrays.stream(providesStr.split(","))
.map(String::trim)
.allMatch(s -> !s.isEmpty());
if (!valid) throw new IllegalArgumentException("provides contains empty capability name: " + providesStr); Try / catch
try {
return CapabilityContract.of(ext, provides, requires);
} catch (IllegalArgumentException e) {
throw new IllegalStateException("Malformed capability declaration in " + ext, e);
} Prevention
- Never build capability lists with String concatenation that can yield empty segments.
- Use List.of(...) plus String.join(",", ...) instead of hand-written comma strings.
- Lint extension descriptors for trailing commas.
When it happens
Trigger: Calling CapabilityContract.of(extension, providesStr, requiresStr) where providesStr contains an empty entry, e.g. a trailing comma ('a,b,'), an empty string segment, or a property like quarkus.provides-capabilities with stray whitespace-only entries.
Common situations: Typo in an extension's build-time capability declaration in its pom.xml / CapabilityProvider, trailing comma in a hand-edited list, string concatenation producing double commas.
Related errors
- Extension ${extension} was configured to require a capabilit
- Failed to load application configuration
- Failed to initialize application configuration
- Unrecognized option for quarkus.bootstrap.misaligned-platfor
- The configuration ${clazz} is missing the @ConfigRoot annota
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/80d608d7d7196952.
Report an issue: GitHub.