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

  1. Remove invalid characters from the --group-id value; use only A-Za-z0-9, '_', '-', '.'.
  2. If the value came from a script variable, echo/printf it first to reveal hidden whitespace and quote it in the shell.
  3. 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

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

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/a6e1b3026cb5ec83. Report an issue: GitHub.