{"record":{"id":"14465e905456048c","repo":"spring-projects/spring-boot","slug":"failed-to-parse-arguments-arguments","errorCode":null,"errorMessage":"Failed to parse arguments [{arguments}]","messagePattern":"Failed to parse arguments \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunArguments.java","lineNumber":73,"sourceCode":"\n\tDeque<String> getArgs() {\n\t\treturn this.args;\n\t}\n\n\tString[] asArray() {\n\t\treturn this.args.toArray(new String[0]);\n\t}\n\n\tstatic String[] parseArgs(@Nullable String arguments) {\n\t\tif (arguments == null || arguments.trim().isEmpty()) {\n\t\t\treturn NO_ARGS;\n\t\t}\n\t\ttry {\n\t\t\targuments = arguments.replace('\\n', ' ').replace('\\t', ' ');\n\t\t\treturn CommandLineUtils.translateCommandline(arguments);\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tthrow new IllegalArgumentException(\"Failed to parse arguments [\" + arguments + \"]\", ex);\n\t\t}\n\t}\n\n}\n","sourceCodeStart":55,"sourceCodeEnd":78,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/270dfe353fb830fd69b823a8a859287ff103854b/build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunArguments.java#L55-L78","documentation":"RunArguments.parseArgs converts a free-form argument string (e.g. the spring-boot.run.arguments Maven property) into a String[]. It normalizes newlines/tabs to spaces and delegates to Maven's CommandLineUtils.translateCommandline, which tokenizes with quote/backslash awareness. If the tokenizer encounters malformed syntax (unclosed quote, dangling escape), the exception is wrapped and rethrown as IllegalArgumentException with the offending arguments embedded in the message.","triggerScenarios":"Setting spring-boot.run.arguments (or jvmArguments) to a value with an unmatched quote, an odd number of backslashes, or otherwise unbalanced quoting that CommandLineUtils.translateCommandline rejects.","commonSituations":"Passing an argument containing spaces without quoting (e.g. --greeting=hello world splits into two tokens); embedding JSON or paths with spaces; copy-pasting values from a shell that already consumed the surrounding quotes.","solutions":["Quote any argument containing spaces: -Dspring-boot.run.arguments=\"--greeting='hello world' --port=8080\"","Pass each argument as its own space-separated token and use single quotes around values that contain spaces","Move complex values into a Maven property and reference them with ${property.name} rather than inlining"],"exampleFix":"// before\n-Dspring-boot.run.arguments=--greeting=hello world\n// after\n-Dspring-boot.run.arguments=\"--greeting=hello world\"","handlingStrategy":"validation","validationCode":"// Pre-validate argument string the same way the plugin will\ntry {\n    org.codehaus.plexus.util.cli.CommandLineUtils.translateCommandline(arguments);\n} catch (Exception e) {\n    throw new IllegalArgumentException(\"Arguments would fail to parse: \" + e.getMessage(), e);\n}","typeGuard":null,"tryCatchPattern":"try { RunArguments.parseArgs(args); } catch (IllegalArgumentException ex) { log.error(\"Malformed run arguments; check quoting: {}\", args); throw ex; }","preventionTips":["Always quote arguments that contain spaces","Use Maven properties instead of inlining complex argument values","Run mvn with -X to see the translated argument array before relying on it"],"tags":["maven-plugin","configuration","argument-parsing"],"backgroundTag":null,"analyzedSha":"270dfe353fb830fd69b823a8a859287ff103854b","analyzedAt":"2026-08-11T19:42:06.541Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}