{"record":{"id":"ba468447951d0193","repo":"quarkusio/quarkus","slug":"failed-to-load-quarkus-properties-from-the-classpa","errorCode":null,"errorMessage":"Failed to load quarkus.properties from the classpath","messagePattern":"Failed to load quarkus\\.properties from the classpath","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/components/MavenVersionEnforcer.java","lineNumber":48,"sourceCode":"        DefaultArtifactVersion detectedVersion = new DefaultArtifactVersion(mavenVersion);\n        enforce(log, supported, detectedVersion);\n    }\n\n    private static String getSupportedMavenVersions() throws IOException {\n        return loadQuarkusProperties().getProperty(\"supported-maven-versions\");\n    }\n\n    private static Properties loadQuarkusProperties() throws IOException {\n        final String resource = \"quarkus.properties\";\n        try (InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource)) {\n            if (is == null) {\n                throw new IOException(\"Could not locate \" + resource + \" on the classpath\");\n            }\n            final Properties props = new Properties();\n            try {\n                props.load(is);\n            } catch (IOException e) {\n                throw new IOException(\"Failed to load \" + resource + \" from the classpath\", e);\n            }\n            return props;\n        }\n    }\n\n    /**\n     * Compares the specified Maven version to see if it is allowed by the defined version range.\n     *\n     * @param log the log\n     * @param requiredMavenVersionRange range of allowed versions for Maven.\n     * @param actualMavenVersion the version to be checked.\n     * @throws MojoExecutionException the given version fails the enforcement rule\n     */\n    private void enforce(Log log,\n            String requiredMavenVersionRange, ArtifactVersion actualMavenVersion)\n            throws MojoExecutionException {\n        if (StringUtils.isBlank(requiredMavenVersionRange)) {\n            throw new MojoExecutionException(\"Maven version can't be empty.\");","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/components/MavenVersionEnforcer.java#L30-L66","documentation":"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'.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Delete the affected quarkus-maven-plugin artifact from ~/.m2 and re-download with ./mvnw -U","Verify jar integrity (unzip -t) and re-fetch from the remote repository if corrupted","Rebuild the plugin locally from the Quarkus source with ./mvnw install -f devtools/maven/ if you patched it","Ensure nothing (AV scanner, fs watcher) is modifying jars under ~/.m2/repository"],"exampleFix":"// before\nmvn quarkus:dev   // fails: quarkus.properties unreadable\n// after\nrm -rf ~/.m2/repository/io/quarkus/quarkus-maven-plugin\n./mvnw -U quarkus:dev","handlingStrategy":"validation","validationCode":"var jar = Path.of(System.getProperty(\"user.home\"),\n    \".m2/repository/io/quarkus/quarkus-maven-plugin/<v>/quarkus-maven-plugin-<v>.jar\");\ntry (var zf = new java.util.zip.ZipFile(jar.toFile())) {\n    var e = zf.getEntry(\"quarkus.properties\");\n    if (e == null || e.getSize() <= 0) throw new IllegalStateException(\"corrupted plugin jar; re-download\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run unzip -t on ~/.m2 jars after IO-related build failures","Exclude ~/.m2 from antivirus/sync tools","Use reliable mirrors","Prefer released artifacts over hand-assembled jars"],"tags":["maven","quarkus","io","corrupt-resource"],"backgroundTag":"resource-load-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}