{"record":{"id":"6898e8f167d9fc7a","repo":"projectlombok/lombok","slug":"either-from-attribute-or-nested-fileset-tags","errorCode":null,"errorMessage":"Either 'from' attribute, or nested <fileset> tags are required.","messagePattern":"Either 'from' attribute, or nested <fileset> tags are required\\.","errorType":"exception","errorClass":"BuildException","httpStatus":null,"severity":"error","filePath":"src/delombok/lombok/delombok/ant/DelombokTaskImpl.java","lineNumber":50,"sourceCode":"import lombok.delombok.Delombok.InvalidFormatOptionException;\n\nimport org.apache.tools.ant.BuildException;\nimport org.apache.tools.ant.Location;\nimport org.apache.tools.ant.types.Path;\nimport org.apache.tools.ant.types.resources.FileResource;\n\npublic class DelombokTaskImpl {\n\tprivate File fromDir, toDir;\n\tprivate Path classpath;\n\tprivate Path sourcepath;\n\tprivate Path modulepath;\n\tprivate boolean verbose;\n\tprivate String encoding;\n\tprivate Path path;\n\tprivate List<String> formatOptions = new ArrayList<String>();\n\t\n\tpublic void execute(Location location) throws BuildException {\n\t\tif (fromDir == null && path == null) throw new BuildException(\"Either 'from' attribute, or nested <fileset> tags are required.\");\n\t\tif (fromDir != null && path != null) throw new BuildException(\"You can't specify both 'from' attribute and nested filesets. You need one or the other.\");\n\t\tif (toDir == null) throw new BuildException(\"The to attribute is required.\");\n\t\t\n\t\tDelombok delombok = new Delombok();\n\t\tif (verbose) delombok.setVerbose(true);\n\t\ttry {\n\t\t\tif (encoding != null) delombok.setCharset(encoding);\n\t\t} catch (UnsupportedCharsetException e) {\n\t\t\tthrow new BuildException(\"Unknown charset: \" + encoding, location);\n\t\t}\n\t\t\n\t\tif (classpath != null) delombok.setClasspath(classpath.toString());\n\t\tif (sourcepath != null) delombok.setSourcepath(sourcepath.toString());\n\t\tif (modulepath != null) delombok.setModulepath(modulepath.toString());\n\t\t\n\t\ttry {\n\t\t\tdelombok.setFormatPreferences(Delombok.formatOptionsToMap(formatOptions));\n\t\t} catch (InvalidFormatOptionException e) {","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/delombok/lombok/delombok/ant/DelombokTaskImpl.java#L32-L68","documentation":"DelombokTaskImpl.execute validates that an input was configured. You must provide either the `from` attribute (a directory) or at least one nested `<fileset>` (exposed as `path`); with neither, delombok has nothing to process and throws BuildException.","triggerScenarios":"An Ant `<delombok to=\"...\">` task with no `from` attribute and no nested `<fileset>`/`<filelist>` elements; calling `execute(Location)` programmatically after setting only `to`.","commonSituations":"Newly written Ant targets that only set `to`; refactoring that removed a `<fileset>` but left the `from`-less task; typo'd `from` attribute name so it is never set.","solutions":["Add `from=\"src/main/java\"` to the delombok task, or","Add a nested `<fileset dir=\"src/main/java\"><include name=\"**/*.java\"/></fileset>`","Verify the attribute is spelled `from` and is actually set in your build"],"exampleFix":"<!-- before -->\n<delombok to=\"build/delomboked\"/>\n<!-- after -->\n<delombok to=\"build/delomboked\" from=\"src/main/java\"/>","handlingStrategy":"validation","validationCode":"if (task.getFrom() == null && !hasFilesets(task)) throw new IllegalStateException(\"delombok needs from or a fileset\");","typeGuard":null,"tryCatchPattern":"catch (BuildException e) { if (e.getMessage().startsWith(\"Either 'from'\")) { /* add input config */ } throw e; }","preventionTips":["Always configure exactly one input source (from XOR filesets)","Smoke-test delombok targets in CI","Keep a template delombok task with both variants commented"],"tags":["ant","build","missing-input","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"6d6a3e9fec0a9555702561fbeb8eac836575116e","analyzedAt":"2026-09-07T23:18:01.841Z","contentChangedAt":"2026-09-07T23:18:01.841Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}