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

  1. Check the wrapped cause (BuildExceptiongetCause()) for the actual IOException
  2. Verify the task's input (baseDir) and output (to/target) directories exist and are writable
  3. Run Ant with -verbose to see the underlying IO error and offending file
  4. 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

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


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)