quarkusio/quarkus · error · IllegalArgumentException
Module id is missing
Error message
Module id is missing
What it means
DefaultWorkspaceModule.Builder.build() throws IllegalArgumentException when the module's id was never set. A workspace module must have a WorkspaceModuleId (GAV-style coordinates) before it can be finished; the library enforces this as a mandatory invariant of the builder protocol.
Source
Thrown at independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/workspace/DefaultWorkspaceModule.java:182
}
@Override
public Builder setAdditionalTestClasspathElements(Collection<String> elements) {
DefaultWorkspaceModule.this.additionalTestClasspathElements = elements;
return this;
}
@Override
public Builder setParent(WorkspaceModule parent) {
DefaultWorkspaceModule.this.parent = parent;
return this;
}
@Override
public WorkspaceModule build() {
final DefaultWorkspaceModule module = DefaultWorkspaceModule.this;
if (module.id == null) {
throw new IllegalArgumentException("Module id is missing");
}
module.directDepConstraints = module.directDepConstraints == null ? Collections.emptyList()
: Collections.unmodifiableList(module.directDepConstraints);
module.directDeps = module.directDeps == null ? Collections.emptyList()
: Collections.unmodifiableList(module.directDeps);
module.sourcesSets = Collections.unmodifiableMap(module.sourcesSets);
return module;
}
@Override
public WorkspaceModuleId getId() {
return DefaultWorkspaceModule.this.getId();
}
@Override
public File getModuleDir() {
return DefaultWorkspaceModule.this.getModuleDir();
}View on GitHub (pinned to e1c734241f)
Solutions
- Call setId(...) with a valid WorkspaceModuleId (e.g. WorkspaceModuleId.of(groupId, artifactId, version)) before build()
- If building from a descriptor, ensure the coordinates are present and parsed into the id
- Add a null check on the id field early in your own code to fail fast with a clearer message
Example fix
// before
DefaultWorkspaceModule.Builder b = new DefaultWorkspaceModule.Builder();
b.addSourceSet(...);
WorkspaceModule m = b.build(); // throws
// after
b.setId(WorkspaceModuleId.of("com.acme", "app", "1.0.0"));
WorkspaceModule m = b.build(); Defensive patterns
Strategy: validation
Validate before calling
if (builderId == null) {
throw new IllegalArgumentException("Set module id before build(); use WorkspaceModuleId.of(g, a, v)");
} Try / catch
try {
WorkspaceModule m = builder.build();
} catch (IllegalArgumentException e) {
if (e.getMessage().equals("Module id is missing")) {
builder.setId(defaultId);
}
} Prevention
- Always call setId(...) immediately after obtaining a workspace module builder
- Centralize builder construction in a factory that enforces the id
- Validate descriptor files contain coordinates before feeding builders
- Write builder setup as a single method so the id is never skipped
When it happens
Trigger: Calling builder.build() without having called setId()/withId(...) (or an equivalent) on the DefaultWorkspaceModule.Builder first.
Common situations: Programmatically constructing workspace modules for tooling/tests and forgetting the id; a workspace descriptor (e.g. a pom or module file) parsed into a builder whose coordinates could not be resolved; copy-pasted builder code that sets dependencies but not the id.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- name cannot be null
- No workspace path provided
- Client ID cannot be empty
- Extra steps left over
- Unknown start character for json value: %s
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/13f028d049b8870d.
Report an issue: GitHub.