quarkusio/quarkus · error · IllegalArgumentException
Invalid workspace module ID string: ${str}
Error message
Invalid workspace module ID string: ${str} What it means
WorkspaceModuleId.fromString parses a colon-separated string and throws IllegalArgumentException if it does not split into exactly 3 parts (groupId:artifactId:version). The library requires the strict GAV form for module ids.
Source
Thrown at independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/workspace/WorkspaceModuleId.java:14
package io.quarkus.bootstrap.workspace;
import io.quarkus.maven.dependency.GAV;
public interface WorkspaceModuleId {
static WorkspaceModuleId of(String groupId, String artifactId, String version) {
return new GAV(groupId, artifactId, version);
}
static WorkspaceModuleId fromString(String str) {
final String[] arr = str.split(":");
if (arr.length != 3) {
throw new IllegalArgumentException("Invalid workspace module ID string: " + str);
}
return of(arr[0], arr[1], arr[2]);
}
String getGroupId();
String getArtifactId();
String getVersion();
}
View on GitHub (pinned to e1c734241f)
Solutions
- Pass exactly groupId:artifactId:version with two ':' separators
- If your input has classifier/type, strip the extra segments before calling fromString
- Validate with a split(':').length == 3 check before calling
Example fix
// before
WorkspaceModuleId id = WorkspaceModuleId.fromString("com.acme:app"); // throws
// after
WorkspaceModuleId id = WorkspaceModuleId.fromString("com.acme:app:1.0.0"); Defensive patterns
Strategy: validation
Validate before calling
boolean isValidModuleId(String s) {
return s != null && s.split(":", -1).length == 3;
} Type guard
Optional<WorkspaceModuleId> tryParseModuleId(String s) {
String[] a = s == null ? new String[0] : s.split(":", -1);
return a.length == 3
? Optional.of(WorkspaceModuleId.of(a[0], a[1], a[2]))
: Optional.empty();
} Try / catch
try {
id = WorkspaceModuleId.fromString(str);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Expected groupId:artifactId:version, got: " + str, e);
} Prevention
- Always build ids via WorkspaceModuleId.of(groupId, artifactId, version) instead of string parsing
- Validate config-derived strings match ^[^:]+:[^:]+:[^:]+$ before parsing
- Strip classifier/type segments from Maven-style coords before calling fromString
When it happens
Trigger: Calling WorkspaceModuleId.fromString(str) where str contains fewer or more than two ':' characters, e.g. "com.acme:app" or "com.acme:app:1.0:extra".
Common situations: Reading module ids from config files or environment variables with typos; passing Maven artifact strings that include classifier/type (5 segments) instead of the 3-segment GAV; trimming or joining errors when composing the string.
Related errors
- One of type, version or separating them ':' is missing from
- ${coords} does not follow format <groupId>:<artifactId>[:<cl
- Invalid coordinates '${str}': groupId and artifactId separat
- One of groupId or artifactId is missing from '${str.substrin
- Unexpected end of input: ${str}
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/03da49193e44c816.
Report an issue: GitHub.