projectlombok/lombok · error · IllegalArgumentException
4th argument must be one of 'all', 'changelog'…
Error message
4th argument must be one of 'all', 'changelog', 'download-edge', 'changelog-latest'
What it means
WebsiteMaker.main dispatches on args[3] (the 4th CLI argument) with equalsIgnoreCase against the known website build modes ('all', 'changelog', 'download-edge', 'changelog-latest', plus 'print-allversions'). An unrecognized value throws this IllegalArgumentException. Note the message list omits 'print-allversions', which is also accepted.
Solutions
- Set the 4th argument to one of: 'all', 'changelog', 'download-edge', 'changelog-latest' (case-insensitive) — 'print-allversions' also works despite not being listed in the message.
- Check argument order: argIn/argOut/version must precede the mode argument.
- Fix typos in your release script or wrapper (e.g. 'changelogs' -> 'changelog').
- Compare with the invocation documented in the repo's release/publish scripts.
Example fix
// before java WebsiteMaker <in> <out> 1.18.30 downloadEdge // after java WebsiteMaker <in> <out> 1.18.30 download-edge
Defensive patterns
Strategy: validation
Validate before calling
java.util.Set<String> modes = java.util.Set.of("all", "changelog", "download-edge", "changelog-latest", "print-allversions");
if (!modes.contains(args[3].toLowerCase(java.util.Locale.ROOT))) throw new IllegalArgumentException("mode must be one of " + modes); Prevention
- Copy the website build command from the repo's release scripts instead of retyping it.
- Remember 'print-allversions' is also accepted even though the message omits it.
- Check argument order: mode must land exactly at args[3].
- Mode matching is case-insensitive but spelling must match ('download-edge', not 'downloadEdge').
When it happens
Trigger: Invoking WebsiteMaker with an args[3] value other than the recognized modes — typo (e.g. 'Download'), renamed/moved mode, argument order mistake so a version string lands in position 3.
Common situations: Hand-typing the website build command in a release script; scripts copied from older docs using a mode name that no longer exists; swapped arguments after editing the command line.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- mandatory argument ' ' missing
- Duplicate argument not allowed
- 4 args required: [path to creds file] [path to file root to…
- 4th arg must be 'true' or 'false'
- Format keys need to be 2 values separated with a colon.
AI-assisted analysis of projectlombok/lombok@6d6a3e9fec (2026-09-07).
Data as JSON: /api/errors/e6e89c02e6deb480.
Report an issue: GitHub.
Appendix: source
Thrown at src/support/lombok/website/WebsiteMaker.java:215
fullVersion = args[2];
}
String argIn = args.length < 5 ? null : args[4];
String argOut = args.length < 6 ? null : args[5];
if (args.length < 4 || args[3].equalsIgnoreCase("all")) {
buildAll(domain, version, fullVersion, argIn, argOut, false);
} else if (args.length < 4 || args[3].equalsIgnoreCase("all-newrelease")) {
buildAll(domain, version, fullVersion, argIn, argOut, true);
} else if (args[3].equalsIgnoreCase("changelog")) {
buildChangelog(version, fullVersion, argIn, argOut);
} else if (args[3].equalsIgnoreCase("download-edge")) {
buildDownloadEdge(version, fullVersion, argIn, argOut);
} else if (args[3].equalsIgnoreCase("changelog-latest")) {
buildChangelogLatest(version, fullVersion, argIn, argOut);
} else if (args[3].equalsIgnoreCase("print-allversions")) {
printAllVersions(domain);
} else {
throw new IllegalArgumentException("4th argument must be one of 'all', 'changelog', 'download-edge', 'changelog-latest'");
}
}
private Configuration makeFreemarkerConfig() throws IOException {
Configuration freemarkerConfig = new Configuration(Configuration.VERSION_2_3_25);
freemarkerConfig.setEncoding(Locale.ENGLISH, "UTF-8");
freemarkerConfig.setOutputEncoding("UTF-8");
freemarkerConfig.setOutputFormat(HTMLOutputFormat.INSTANCE);
freemarkerConfig.setTemplateLoader(createLoader());
freemarkerConfig.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
return freemarkerConfig;
}
public void buildChangelog(File out) throws Exception {
Configuration freemarkerConfig = makeFreemarkerConfig();
outputDir.mkdirs();
convertChangelog(freemarkerConfig, out);
}View on GitHub (pinned to 6d6a3e9fec)