{"record":{"id":"c205c4218f6d0927","repo":"apache/maven","slug":"unable-to-read-the-resume-r-feature-will","errorCode":null,"errorMessage":"Unable to read {}. The --resume / -r feature will not work.","messagePattern":"Unable to read (.+?)\\. The --resume / -r feature will not work\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"impl/maven-core/src/main/java/org/apache/maven/execution/DefaultBuildResumptionDataRepository.java","lineNumber":103,"sourceCode":"        try {\n            Files.deleteIfExists(resumeProperties);\n        } catch (IOException e) {\n            LOGGER.warn(\"Could not delete {} file. \", RESUME_PROPERTIES_FILENAME, e);\n        }\n    }\n\n    private Properties loadResumptionFile(Path rootBuildDirectory) {\n        Properties properties = new Properties();\n        Path path = rootBuildDirectory.resolve(RESUME_PROPERTIES_FILENAME);\n        if (!Files.exists(path)) {\n            LOGGER.warn(\"The {} file does not exist. The --resume / -r feature will not work.\", path);\n            return properties;\n        }\n\n        try (Reader reader = Files.newBufferedReader(path)) {\n            properties.load(reader);\n        } catch (IOException e) {\n            LOGGER.warn(\"Unable to read {}. The --resume / -r feature will not work.\", path);\n        }\n\n        return properties;\n    }\n\n    // This method is made package-private for testing purposes\n    void applyResumptionProperties(MavenExecutionRequest request, Properties properties) {\n        String str1 = request.getResumeFrom();\n        if (properties.containsKey(REMAINING_PROJECTS) && !(str1 != null && !str1.isEmpty())) {\n            String propertyValue = properties.getProperty(REMAINING_PROJECTS);\n            Stream.of(propertyValue.split(PROPERTY_DELIMITER))\n                    .filter(str -> !str.isEmpty())\n                    .forEach(request.getProjectActivation()::activateOptionalProjectNonRecursive);\n            LOGGER.info(\"Resuming from {} due to the --resume / -r feature.\", propertyValue);\n        }\n    }\n}\n","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/execution/DefaultBuildResumptionDataRepository.java#L85-L121","documentation":"loadResumptionFile found root-module target/resume.properties but properties.load(reader) threw IOException: the file is unreadable, truncated, or otherwise corrupt. Maven falls back to empty properties, so --resume / -r silently behaves like a full build.","triggerScenarios":"A build process killed while persisting resume.properties leaves a truncated file; the file exists but the build user lacks read permission; disk-level I/O errors while reading the target directory.","commonSituations":"CI agents forcibly terminated (OOMKilled, timeout kill) mid-write; workspace permission changes between jobs; exotic encodings of project paths stored in the properties file.","solutions":["Delete root-module target/resume.properties, run one full build to let it fail and regenerate the file, then resume with mvn -r","Check read permissions on target/resume.properties and the enclosing directory","If it recurs frequently, capture the file right after the failure and report it - repeated truncation suggests persistence is being interrupted"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// sanity-check the resume file parses before relying on -r\nPath resume = Paths.get(rootProject.getBuild().getDirectory(), \"resume.properties\");\nif (Files.exists(resume)) {\n    try (Reader r = Files.newBufferedReader(resume)) {\n        Properties p = new Properties();\n        p.load(r);\n        if (p.getProperty(\"remainingProjects\") == null) {\n            Files.deleteIfExists(resume); // regenerate on next failure\n        }\n    } catch (IOException e) {\n        Files.deleteIfExists(resume);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Let CI kill builds gracefully (SIGTERM) so property writes are not truncated","If a job was force-killed, delete root target/resume.properties before retrying -r"],"tags":["resume","corrupt-file","io","maven-4"],"backgroundTag":"config-file-read-failure","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}