quarkusio/quarkus · error · IOException

Failed to load quarkus.properties from the classpath

Error message

Failed to load quarkus.properties from the classpath

What it means

loadQuarkusProperties throws this IOException when quarkus.properties was found on the classpath but Properties.load fails while parsing it. This means the resource exists but its content is unreadable/corrupt (invalid stream). It propagates up as 'Failed to ensure Quarkus Maven version compatibility'.

Source

Thrown at devtools/maven/src/main/java/io/quarkus/maven/components/MavenVersionEnforcer.java:48

        DefaultArtifactVersion detectedVersion = new DefaultArtifactVersion(mavenVersion);
        enforce(log, supported, detectedVersion);
    }

    private static String getSupportedMavenVersions() throws IOException {
        return loadQuarkusProperties().getProperty("supported-maven-versions");
    }

    private static Properties loadQuarkusProperties() throws IOException {
        final String resource = "quarkus.properties";
        try (InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource)) {
            if (is == null) {
                throw new IOException("Could not locate " + resource + " on the classpath");
            }
            final Properties props = new Properties();
            try {
                props.load(is);
            } catch (IOException e) {
                throw new IOException("Failed to load " + resource + " from the classpath", e);
            }
            return props;
        }
    }

    /**
     * Compares the specified Maven version to see if it is allowed by the defined version range.
     *
     * @param log the log
     * @param requiredMavenVersionRange range of allowed versions for Maven.
     * @param actualMavenVersion the version to be checked.
     * @throws MojoExecutionException the given version fails the enforcement rule
     */
    private void enforce(Log log,
            String requiredMavenVersionRange, ArtifactVersion actualMavenVersion)
            throws MojoExecutionException {
        if (StringUtils.isBlank(requiredMavenVersionRange)) {
            throw new MojoExecutionException("Maven version can't be empty.");

View on GitHub (pinned to e1c734241f)

Solutions

  1. Delete the affected quarkus-maven-plugin artifact from ~/.m2 and re-download with ./mvnw -U
  2. Verify jar integrity (unzip -t) and re-fetch from the remote repository if corrupted
  3. Rebuild the plugin locally from the Quarkus source with ./mvnw install -f devtools/maven/ if you patched it
  4. Ensure nothing (AV scanner, fs watcher) is modifying jars under ~/.m2/repository

Example fix

// before
mvn quarkus:dev   // fails: quarkus.properties unreadable
// after
rm -rf ~/.m2/repository/io/quarkus/quarkus-maven-plugin
./mvnw -U quarkus:dev
Defensive patterns

Strategy: validation

Validate before calling

var jar = Path.of(System.getProperty("user.home"),
    ".m2/repository/io/quarkus/quarkus-maven-plugin/<v>/quarkus-maven-plugin-<v>.jar");
try (var zf = new java.util.zip.ZipFile(jar.toFile())) {
    var e = zf.getEntry("quarkus.properties");
    if (e == null || e.getSize() <= 0) throw new IllegalStateException("corrupted plugin jar; re-download");
}

Prevention

When it happens

Trigger: Calling getSupportedMavenVersions where the InputStream for quarkus.properties opens but props.load(is) throws IOException — e.g. truncated, corrupted, or binary-mangled resource inside the plugin jar.

Common situations: Disk corruption or an interrupted download left a bad jar in ~/.m2; a build tool or antivirus partially unpacked/rewrote the jar; a custom build produced a jar with a malformed quarkus.properties.

Related errors


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