{"record":{"id":"24ad97f362b99524","repo":"apache/maven","slug":"could-not-create-resume-properties-file","errorCode":null,"errorMessage":"Could not create resume.properties file.","messagePattern":"Could not create resume\\.properties file\\.","errorType":"exception","errorClass":"BuildResumptionPersistenceException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/execution/DefaultBuildResumptionDataRepository.java","lineNumber":62,"sourceCode":"    private static final String RESUME_PROPERTIES_FILENAME = \"resume.properties\";\n    private static final String REMAINING_PROJECTS = \"remainingProjects\";\n    private static final String PROPERTY_DELIMITER = \", \";\n    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultBuildResumptionDataRepository.class);\n\n    @Override\n    public void persistResumptionData(MavenProject rootProject, BuildResumptionData buildResumptionData)\n            throws BuildResumptionPersistenceException {\n        Properties properties = convertToProperties(buildResumptionData);\n\n        Path resumeProperties = Paths.get(rootProject.getBuild().getDirectory(), RESUME_PROPERTIES_FILENAME);\n        try {\n            Files.createDirectories(resumeProperties.getParent());\n            try (Writer writer = Files.newBufferedWriter(resumeProperties)) {\n                properties.store(writer, null);\n            }\n        } catch (IOException e) {\n            String message = \"Could not create \" + RESUME_PROPERTIES_FILENAME + \" file.\";\n            throw new BuildResumptionPersistenceException(message, e);\n        }\n    }\n\n    private Properties convertToProperties(final BuildResumptionData buildResumptionData) {\n        Properties properties = new Properties();\n\n        String value = String.join(PROPERTY_DELIMITER, buildResumptionData.getRemainingProjects());\n        properties.setProperty(REMAINING_PROJECTS, value);\n\n        return properties;\n    }\n\n    @Override\n    public void applyResumptionData(MavenExecutionRequest request, MavenProject rootProject) {\n        Properties properties =\n                loadResumptionFile(Paths.get(rootProject.getBuild().getDirectory()));\n        applyResumptionProperties(request, properties);\n    }","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/execution/DefaultBuildResumptionDataRepository.java#L44-L80","documentation":"Maven could not write target/resume.properties, the file that powers --resume/-r by recording the projects still to build after a --fail-at-end run. DefaultBuildResumptionDataRepository.persistResumptionData() creates the build directory and stores a Properties file; any IOException (directory creation, open, or write failure) is wrapped in BuildResumptionPersistenceException with this message.","triggerScenarios":"A --fail-at-end build reaches resumption-data persistence while rootProject.getBuild().getDirectory() (usually target/) cannot be created or written: permission denied, read-only filesystem, disk full, resume.properties locked by another process (Windows), or the path occupied by a regular file.","commonSituations":"CI workspaces with restricted permissions; disk-full agents; two builds racing on the same checkout/target directory; antivirus or file indexers locking files on Windows.","solutions":["Verify the project's target/ directory is creatable and writable; fix ownership/permissions or free disk space","Delete a stale/corrupt target/resume.properties and rerun","Prevent concurrent builds from sharing one build directory","If resumption is not needed, drop the -r/--resume and --fail-at-end combination that triggers persistence"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before the build, ensure the resumption file location is writable\nPath target = project.getBasedir().toPath().resolve(\"target\");\nFiles.createDirectories(target);\nPath probe = target.resolve(\".write-probe\");\nFiles.writeString(probe, \"x\");\nFiles.deleteIfExists(probe);","typeGuard":null,"tryCatchPattern":"try {\n    resumptionDataRepository.persistResumptionData(rootProject, data);\n} catch (BuildResumptionPersistenceException e) {\n    // Resumption is an optimization: log, keep building, but tell the user -r will not work\n    log.warn(\"--resume will be unavailable: {}\", e.getCause().getMessage());\n}","preventionTips":["Keep target/ directories writable and on disks with space in CI","Do not share one checkout between concurrent builds","Clean stale resume.properties when re-baselining a failed build"],"tags":["maven","io","file-permissions","resume","disk-full"],"backgroundTag":"output-file-write-failed","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}