{"record":{"id":"a1acd988911d22f0","repo":"projectlombok/lombok","slug":"mandatory-argument-key-missing","errorCode":null,"errorMessage":"mandatory argument '<key>' missing","messagePattern":"mandatory argument '<key>' missing","errorType":"console","errorClass":"InvalidCommandLineException","httpStatus":null,"severity":"error","filePath":"src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java","lineNumber":156,"sourceCode":"\t\t\tif (bootpath != null) launchContent.append(\" -Ddelombok.bootclasspath=\" + bootpath);\n\t\t}\n\t\tlaunchContent.append(\"\\\"/>\\n</launchConfiguration>\\n\");\n\t}\n\t\n\tprivate String getBootPath() {\n\t\tString bp = args.get(\"bootpath\");\n\t\tif (bp == null || bp.isEmpty() || bp.equals(\"0\")) return null;\n\t\tFile f = new File(bp);\n\t\tif (!f.isAbsolute()) return bp;\n\t\tString r = new File(\".\").getAbsolutePath();\n\t\tif (r.endsWith(\".\")) r = r.substring(0, r.length() - 1);\n\t\tif (bp.startsWith(r)) return bp.substring(r.length());\n\t\tthrow new IllegalStateException(\"Cannot reconstruct relative path; base: \" + r + \" is not a parent of \" + bp);\n\t}\n\t\n\tprivate String getArgString(String key) throws InvalidCommandLineException {\n\t\tString v = args.get(key);\n\t\tif (v == null) throw new InvalidCommandLineException(\"mandatory argument '\" + key + \"' missing\");\n\t\treturn v;\n\t}\n\t\n\tprivate boolean getArgBoolean(String key) throws InvalidCommandLineException {\n\t\tString v = args.get(key);\n\t\tif (v == null) return false;\n\t\tif (v.equalsIgnoreCase(\"false\") || v.equalsIgnoreCase(\"f\")) return false;\n\t\treturn true;\n\t}\n\t\n\tprivate static void printCommandLineHelp() {\n\t\tSystem.err.println(\"CreateEclipseDebugTarget\\n\" +\n\t\t\t\"   name=Lombok-test BaseJavac 11           # Sets the name of the debug target to make\\n\" +\n\t\t\t\"   testType=lombok.RunJavacAndBaseTests    # The test class file that this debug target should run\\n\" +\n\t\t\t\"   shadowLoaderBased                       # Add the VM options to use lombok as an agent and pass the classpath to the shadow loader. Needed for ECJ/Eclipse.\\n\" +\n\t\t\t\"   conf.test=foo:bar:baz                   # Where 'test' is an ivy conf name, and 'foo' is a path to a jar, relativized vs. current directory.\\n\" +\n\t\t\t\"   favorite                                # Should the debug target be marked as favourite?\\n\" +\n\t\t\t\"\");","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java#L138-L174","documentation":"CreateEclipseDebugTarget.getArgString requires a value for mandatory command-line keys; a null lookup means the key wasn't supplied, so it throws InvalidCommandLineException \"mandatory argument '<key>' missing\". Called by n, type and jvmTarget parsing.","triggerScenarios":"Running the tool without a required argument such as type, jvmTarget, or the one used to compute the project name n; the args map has no entry for that key.","commonSituations":"Incomplete command line copied from docs, dropped argument in a script, misspelled argument name (keys are case-sensitive).","solutions":["Add the missing argument named in the message to the command line","Check spelling/casing of the argument key","Consult the tool's main/usage to list required keys","Wrap invocation in a script that supplies defaults for required keys"],"exampleFix":"// before\njava ... type=\n// after\njava ... type=java jvmTarget=17","handlingStrategy":"validation","validationCode":"Set<String> required = Set.of(\"type\", \"jvmTarget\", /* key for name */);\nfor (String k : required) if (!argsMap.containsKey(k)) throw new IllegalArgumentException(\"missing arg: \" + k);","typeGuard":null,"tryCatchPattern":"try { tool.main(argv); } catch (InvalidCommandLineException e) { if (e.getMessage().contains(\"mandatory argument\")) { printUsage(e.getMessage()); } throw e; }","preventionTips":["Keep a canonical invocation script that always passes required keys","Match argument key casing exactly","Validate the command line in CI before launching the tool"],"tags":["java","cli","missing-argument","launch-config"],"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"}