quarkusio/quarkus · error · TypeConversionException
The specified %s identifier (%s) contains invalid characters
Error message
The specified %s identifier (%s) contains invalid characters. Valid characters are alphanumeric characters (A-Za-z0-9), underscores, dashes and dots.
What it means
Thrown by TargetGAVGroup.projectGav when a user-supplied --group-id / artifact coordinate fails the OK_ID regex (alphanumerics, underscores, dashes, dots). The CLI validates Maven identifiers early so project generation does not produce an unusable pom.xml. It is wrapped in a picocli TypeConversionException so picocli reports it as a parameter conversion failure.
Source
Thrown at devtools/cli/src/main/java/io/quarkus/cli/create/TargetGAVGroup.java:62
// g:a: -- (uncommon alternate)
// g:a:v -- COMMON
// :a: -- (uncommon alternate)
// :a:v -- (uncommon)
if (firstPos != 0) {
groupId = gav.substring(0, firstPos);
}
if (lastPos == firstPos) {
artifactId = gav.substring(firstPos + 1);
} else if (lastPos >= firstPos + 2) {
artifactId = gav.substring(firstPos + 1, lastPos);
}
if (lastPos > firstPos && lastPos <= gav.length() - 2) {
version = gav.substring(lastPos + 1);
}
}
}
if (artifactId != CreateProjectHelper.DEFAULT_ARTIFACT_ID && !OK_ID.matcher(artifactId).matches()) {
throw new TypeConversionException(String.format(BAD_IDENTIFIER, "artifactId", artifactId));
}
if (groupId != CreateProjectHelper.DEFAULT_GROUP_ID && !OK_ID.matcher(groupId).matches()) {
throw new TypeConversionException(String.format(BAD_IDENTIFIER, "groupId", groupId));
}
initialized = true;
}
}
public String getGroupId() {
projectGav();
return groupId;
}
public String getArtifactId() {
projectGav();
return artifactId;
}View on GitHub (pinned to e1c734241f)
Solutions
- Remove invalid characters from the --group-id value; use only A-Za-z0-9, '_', '-', '.'.
- If the value came from a script variable, echo/printf it first to reveal hidden whitespace and quote it in the shell.
- If you actually meant to pass a full GAV, use the group:artifact:version form so each part is validated separately.
Example fix
// before quarkus create --group-id 'com/myco app' // after quarkus create --group-id com.myco.app
Defensive patterns
Strategy: validation
Validate before calling
public static boolean isValidGroupId(String g) {
return g == null || g.matches("[A-Za-z0-9_.-]+");
}
// call before: if (!isValidGroupId(groupId)) throw new IllegalArgumentException(groupId); Type guard
public static boolean isSafeId(String s) {
return s != null && !s.isBlank() && s.chars().allMatch(c ->
Character.isLetterOrDigit(c) || c == '_' || c == '-' || c == '.');
} Prevention
- Regex-check identifiers against [A-Za-z0-9_.-]+ before invoking the CLI.
- Quote shell variables and strip whitespace: "${VAR// /}".
- Prefer reverse-domain group ids like com.example.app.
- Avoid building ids via string concatenation from user or file-system input.
When it happens
Trigger: Running `quarkus create` with a --group-id (or GAV parsed from a single -Dvalue in projectGav) containing characters outside [A-Za-z0-9_.-], e.g. spaces, '@', ':', '~', or a leading symbol, while the value is not the placeholder default group id.
Common situations: Copy-pasting a group id from a document with a trailing space or smart quote; using an email-like or URL-like group id ('myorg/team'); shell-interpolated variables containing slashes; typos like 'com.acme!!'.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Failed to compile. Compilation exited with exit code:${exitC
- Invalid value '%s' for option '--stream'. Value should be sp
- Invalid value '%s' for option '--platform-bom'. Value should
- One or more errors happened during the configuration documen
- ${BAD_IDENTIFIER formatted with 'artifactId' and projectArti
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/a6e1b3026cb5ec83.
Report an issue: GitHub.