apache/maven · warning
Unable to read {}. The --resume / -r feature will not work.
Error message
Unable to read {}. The --resume / -r feature will not work. What it means
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.
Source
Thrown at impl/maven-core/src/main/java/org/apache/maven/execution/DefaultBuildResumptionDataRepository.java:103
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))
.filter(str -> !str.isEmpty())
.forEach(request.getProjectActivation()::activateOptionalProjectNonRecursive);
LOGGER.info("Resuming from {} due to the --resume / -r feature.", propertyValue);
}
}
}
View on GitHub (pinned to e4093d4e12)
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
Defensive patterns
Strategy: validation
Validate before calling
// sanity-check the resume file parses before relying on -r
Path resume = Paths.get(rootProject.getBuild().getDirectory(), "resume.properties");
if (Files.exists(resume)) {
try (Reader r = Files.newBufferedReader(resume)) {
Properties p = new Properties();
p.load(r);
if (p.getProperty("remainingProjects") == null) {
Files.deleteIfExists(resume); // regenerate on next failure
}
} catch (IOException e) {
Files.deleteIfExists(resume);
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: CI agents forcibly terminated (OOMKilled, timeout kill) mid-write; workspace permission changes between jobs; exotic encodings of project paths stored in the properties file.
Related errors
- Could not create resume.properties file.
- The {} file does not exist. The --resume / -r feature will n
- Unable to prompt
- Error copying POM to the local repository.
- The super POM {resource} is damaged, please verify the integ
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/c205c4218f6d0927.
Report an issue: GitHub.