quarkusio/quarkus · error · RuntimeException

Failed to determine the version of module

Error message

Failed to determine the version of module 

What it means

WorkspaceModulePom.getResolvedVersion resolves a module's version, which may be inherited from its parent POM. It walks the parent chain and throws this RuntimeException when no POM in the chain declares a version. A Maven model is invalid without a resolvable version, so the module cannot be identified in the workspace.

Source

Thrown at independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/WorkspaceModulePom.java:147

     */
    String getResolvedVersion() {
        if (effectiveModel != null) {
            return effectiveModel.getVersion();
        }
        final Model model = getModel();
        if (model != null) {
            String version = ModelUtils.getRawVersionOrNull(model);
            if (version != null && ModelUtils.isUnresolvedVersion(version)) {
                version = ModelUtils.resolveVersion(version, model);
            }
            if (version != null) {
                return version;
            }
        }
        if (parent != null) {
            return parent.getResolvedVersion();
        }
        throw new RuntimeException("Failed to determine the version of module " + pom);
    }

    /**
     * Allows scheduling module loading after this module has been loaded.
     *
     * @param module module to load once this module has been loaded
     */
    void thenLoad(WorkspaceModulePom module) {
        thenLoad.add(module);
    }

    /**
     * Modules that should be loaded after this module.
     *
     * @return modules that should be loaded after this module
     */
    Deque<WorkspaceModulePom> getThenLoad() {
        return thenLoad;

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add an explicit <version> to the module's pom.xml
  2. Fix the <parent> block so the parent resolves and supplies the inherited version
  3. Ensure the parent POM is loadable and included in the workspace module tree
  4. Check that version properties (e.g. ${revision}) are defined via -Drevision=... or a .mvn/maven.config file

Example fix

// before: mvn command without CI-friendly version
mvn quarkus:dev
// after: supply the placeholder
mvn quarkus:dev -Drevision=1.0.0
Defensive patterns

Strategy: validation

Validate before calling

Document pom = modelReader.read(pomFile.toFile(), null);
boolean hasVersion = pom.getVersion() != null
    || (pom.getParent() != null && pom.getParent().getVersion() != null);
if (!hasVersion) throw new IllegalStateException(pomFile + " has no resolvable version");

Try / catch

try {
    String version = wsModulePom.getResolvedVersion();
} catch (RuntimeException e) {
    log.error("Add explicit <version> or supply CI-friendly properties: " + e.getMessage());
}

Prevention

When it happens

Trigger: A module pom.xml (and its whole parent chain) declares no <version> — typically a child omitting <version> while its <parent> cannot be resolved (wrong coordinates/relativePath) or the parent itself has no version.

Common situations: Child POMs depending on parent inheritance but the parent POM is missing from the workspace; CI-style version placeholders (${revision}) unset; hand-edited POMs with the version removed.

Related errors


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