quarkusio/quarkus · error · UncheckedIOException

Failed to load POM from

Error message

Failed to load POM from 

What it means

WorkspaceLoader.readModel(Path pom) wraps ModelUtils.readModel failures. A NoSuchFileException is tolerated (module treated as thirdparty), but any other IOException while reading a POM is rethrown as UncheckedIOException("Failed to load POM from " + pom). It indicates the pom.xml exists but could not be read or parsed.

Source

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

    }

    static Path getFsRootDir() {
        return Path.of("/");
    }

    static Model readModel(Path pom) {
        try {
            final Model model = ModelUtils.readModel(pom);
            model.setPomFile(pom.toFile());
            return model;
        } catch (NoSuchFileException e) {
            // some projects may be missing pom.xml relying on Maven extensions (e.g. tycho-maven-plugin) to build them,
            // which we don't support in this workspace loader
            log.warn("Module(s) under " + pom.getParent() + " will be handled as thirdparty dependencies because " + pom
                    + " does not exist");
            return MISSING_MODEL;
        } catch (IOException e) {
            throw new UncheckedIOException("Failed to load POM from " + pom, e);
        }
    }

    private static Path locateCurrentProjectPom(Path path) throws BootstrapMavenException {
        Path p = path;
        while (p != null) {
            final Path pom = p.resolve(POM_XML);
            if (Files.exists(pom)) {
                return pom;
            }
            p = p.getParent();
        }
        throw new BootstrapMavenException("Failed to locate project pom.xml for " + path);
    }

    private final Deque<WorkspaceModulePom> loadQueue = new ConcurrentLinkedDeque<>();
    // Map key is the normalized absolute Path to the module directory
    private final Map<Path, WorkspaceModulePom> knownModules = new ConcurrentHashMap<>();

View on GitHub (pinned to e1c734241f)

Solutions

  1. Fix the underlying cause shown in the wrapped exception's cause (parse error vs permission vs I/O) — inspect e.getCause().
  2. Check file permissions/ownership of the pom.xml and that no other process holds it locked.
  3. Validate the module's pom.xml with `mvn validate` or `xmllint --noout` and fix any XML errors.
  4. Check filesystem health/mounts if the project lives on a network or removable drive.

Example fix

// diagnosing
try {
    loader.load();
} catch (UncheckedIOException e) {
    e.getCause().printStackTrace(); // e.g. XmlPullParserException wrapped in IOException
}
// typical fix: repair malformed XML in the reported module pom
Defensive patterns

Strategy: try-catch

Validate before calling

static void requireReadablePom(Path pom) throws IOException {
    if (!Files.isRegularFile(pom)) throw new NoSuchFileException(pom.toString());
    if (!Files.isReadable(pom)) throw new IOException("Not readable: " + pom);
}

Type guard

static boolean isReadablePom(Path pom) {
    return pom != null && Files.isRegularFile(pom) && Files.isReadable(pom);
}

Try / catch

try {
    loader.load();
} catch (UncheckedIOException e) {
    Throwable cause = e.getCause();
    log.error("Failed to load POM: " + cause.getMessage() + " (check permissions/XML validity)");
}

Prevention

When it happens

Trigger: WorkspaceLoader loading a queued WorkspaceModulePom whose pom.xml throws a non-NoSuchFile IOException: permission denied, an I/O error, or a parse failure (malformed XML) surfaced as IOException from ModelUtils.readModel.

Common situations: pom.xml unreadable due to file permissions or being locked by another process on Windows; malformed XML in a multi-module build module; filesystem errors (network drive dropped, disk full); symlink loops.

Related errors


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