apache/maven · warning
The {} file does not exist. The --resume / -r feature will n
Error message
The {} file does not exist. The --resume / -r feature will not work. What it means
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.
Source
Thrown at impl/maven-core/src/main/java/org/apache/maven/execution/DefaultBuildResumptionDataRepository.java:96
loadResumptionFile(Paths.get(rootProject.getBuild().getDirectory()));
applyResumptionProperties(request, properties);
}
@Override
public void removeResumptionData(MavenProject rootProject) {
Path resumeProperties = Paths.get(rootProject.getBuild().getDirectory(), RESUME_PROPERTIES_FILENAME);
try {
Files.deleteIfExists(resumeProperties);
} catch (IOException e) {
LOGGER.warn("Could not delete {} file. ", RESUME_PROPERTIES_FILENAME, e);
}
}
private Properties loadResumptionFile(Path rootBuildDirectory) {
Properties properties = new Properties();
Path path = rootBuildDirectory.resolve(RESUME_PROPERTIES_FILENAME);
if (!Files.exists(path)) {
LOGGER.warn("The {} file does not exist. The --resume / -r feature will not work.", path);
return properties;
}
try (Reader reader = Files.newBufferedReader(path)) {
properties.load(reader);
} catch (IOException e) {
LOGGER.warn("Unable to read {}. The --resume / -r feature will not work.", path);
}
return properties;
}
// This method is made package-private for testing purposes
void applyResumptionProperties(MavenExecutionRequest request, Properties properties) {
String str1 = request.getResumeFrom();
if (properties.containsKey(REMAINING_PROJECTS) && !(str1 != null && !str1.isEmpty())) {
String propertyValue = properties.getProperty(REMAINING_PROJECTS);
Stream.of(propertyValue.split(PROPERTY_DELIMITER))View on GitHub (pinned to e4093d4e12)
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
Example fix
# before (nothing persisted yet) mvn -r clean install # warns: file does not exist, builds everything # after mvn clean install # fails, writes <root>/target/resume.properties mvn -r clean install # resumes remaining projects only
Defensive patterns
Strategy: validation
Validate before calling
// check resumption state exists before requesting a resume
Path resume = Paths.get(rootProject.getBuild().getDirectory(), "resume.properties");
if (request.isResume() && !Files.exists(resume)) {
request.setResume(false); // avoid the warning: fall back to full build explicitly
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- Unable to read {}. The --resume / -r feature will not work.
- Two or more projects in the reactor have the same identifier
- Could not create resume.properties file.
- The project exclusion%s in --projects/-pl resulted in an emp
- Invalid reactor make behavior: {}
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/fa1e1c2136c2baaa.
Report an issue: GitHub.