projectlombok/lombok · error · BuildException
I/O problem during delombok
Error message
I/O problem during delombok
What it means
Lombok's Ant DelombokTaskImpl wraps any IOException thrown while running delombok() in an Ant BuildException with this message. It means file I/O (reading sources, writing output) failed during the delombok run.
Solutions
- Check the wrapped cause (BuildExceptiongetCause()) for the actual IOException
- Verify the task's input (baseDir) and output (to/target) directories exist and are writable
- Run Ant with -verbose to see the underlying IO error and offending file
- Fix filesystem permissions or free disk space
Example fix
<!-- before --> <delombok to="build/delombok"/> <!-- after: ensure dirs exist and are writable --> <mkdir dir="build/delombok"/> <delombok from="src/main/java" to="build/delombok"/>
Defensive patterns
Strategy: try-catch
Validate before calling
if (!new File(baseDir).canRead()) throw new IllegalStateException("unreadable source dir");
File out = new File(toDir); if (!out.exists() && !out.mkdirs()) throw new IllegalStateException("cannot create output dir");
if (!out.canWrite()) throw new IllegalStateException("output dir not writable"); Try / catch
try { delombokTask.execute(); } catch (BuildException e) { if (e.getCause() instanceof IOException) { log("Delombok IO failure: " + e.getCause().getMessage()); } throw e; } Prevention
- Always mkdir the delombok output directory before running the task
- Run CI builds with a writable workspace user
- Check BuildException.getCause() to diagnose the real IOException
When it happens
Trigger: Running the 'delombok' Ant task when delombok.delombok() encounters an IOException: source files missing under baseDir, output directory not writable, or disk errors.
Common situations: Ant build with a bad source/output directory path, read-only output dir, files deleted between scan and delombok, permission problems in CI.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- 'value' property required for
- Either 'from' attribute, or nested
- You can't specify both 'from' attribute and nested…
- The to attribute is required.
- Unknown charset
AI-assisted analysis of projectlombok/lombok@6d6a3e9fec (2026-09-07).
Data as JSON: /api/errors/dcbcb83e9c34c22e.
Report an issue: GitHub.
Appendix: source
Thrown at src/delombok/lombok/delombok/ant/DelombokTaskImpl.java:90
delombok.setOutput(toDir);
try {
if (fromDir != null) delombok.addDirectory(fromDir);
else {
Iterator<?> it = path.iterator();
while (it.hasNext()) {
FileResource fileResource = (FileResource) it.next();
File baseDir = fileResource.getBaseDir();
if (baseDir == null) {
File file = fileResource.getFile();
delombok.addFile(file.getParentFile(), file.getName());
} else {
delombok.addFile(baseDir, fileResource.getName());
}
}
}
delombok.delombok();
} catch (IOException e) {
throw new BuildException("I/O problem during delombok", e, location);
}
}
}
View on GitHub (pinned to 6d6a3e9fec)