{"record":{"id":"fa1e1c2136c2baaa","repo":"apache/maven","slug":"the-file-does-not-exist-the-resume-r-feat","errorCode":null,"errorMessage":"The {} file does not exist. The --resume / -r feature will not work.","messagePattern":"The (.+?) file does not exist\\. 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":96,"sourceCode":"                loadResumptionFile(Paths.get(rootProject.getBuild().getDirectory()));\n        applyResumptionProperties(request, properties);\n    }\n\n    @Override\n    public void removeResumptionData(MavenProject rootProject) {\n        Path resumeProperties = Paths.get(rootProject.getBuild().getDirectory(), RESUME_PROPERTIES_FILENAME);\n        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))","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/execution/DefaultBuildResumptionDataRepository.java#L78-L114","documentation":"With mvn -r / --resume, Maven re-runs only the projects that failed plus their downstream modules, reading that list from resume.properties in the root (first) module's target/. This warning says the file is absent, so the resume feature degenerates to a full build of all tasks.","triggerScenarios":"Invoking mvn -r before any build has failed and persisted data; the previous build succeeded (removeResumptionData deleted the file); the previous build failed so early that persistResumptionData never ran; running -r in a way that resolves a different root project (different execution root).","commonSituations":"First-ever build of a project; a CI job wiping target/ between attempts; invoking --resume with --resume-from (which does not read the file); Maven 3, where the flag does not exist.","solutions":["Run the build once WITHOUT -r and let it fail so that resume.properties is written into the root module's target/, then re-run mvn -r","Verify the root module's target/ actually contains resume.properties (ls <root>/target/resume.properties)","If the previous build succeeded there is nothing to resume - run without -r","Make sure no cleanup (mvn clean between attempts, CI workspace wiping) removes target/ after a failed build"],"exampleFix":"# before (nothing persisted yet)\nmvn -r clean install   # warns: file does not exist, builds everything\n# after\nmvn clean install       # fails, writes <root>/target/resume.properties\nmvn -r clean install    # resumes remaining projects only","handlingStrategy":"validation","validationCode":"// check resumption state exists before requesting a resume\nPath resume = Paths.get(rootProject.getBuild().getDirectory(), \"resume.properties\");\nif (request.isResume() && !Files.exists(resume)) {\n    request.setResume(false); // avoid the warning: fall back to full build explicitly\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only pass -r after a build has actually failed and written target/resume.properties","Do not run mvn clean between the failed attempt and the -r retry","Remember the file lives in the ROOT module's target/, not the CWD's"],"tags":["resume","maven-4","build-restart","reactor"],"backgroundTag":"resume-state-file-missing","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}