{"record":{"id":"3e74991e01813810","repo":"quarkusio/quarkus","slug":"invalid-environment-variable-envvar","errorCode":null,"errorMessage":"Invalid environment variable: ${envVar}","messagePattern":"Invalid environment variable: (.+?)","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/RunMojo.java","lineNumber":160,"sourceCode":"                            .error().inherited();\n                    if (workingDirectory != null) {\n                        pb.directory(workingDirectory);\n                    }\n                    if ((environmentVariables != null) && !environmentVariables.isEmpty()) {\n                        pb.environment(envVarsAsMap());\n                    }\n                    pb.run();\n                }\n\n                private Map<String, String> envVarsAsMap() {\n                    String[] envVars = environmentVariables.split(\",\");\n                    Map<String, String> env = new HashMap<>();\n                    for (String envVar : envVars) {\n                        String[] parts = envVar.split(\"=\", 2);\n                        if (parts.length == 2) {\n                            env.put(parts[0], parts[1]);\n                        } else {\n                            throw new RuntimeException(\"Invalid environment variable: \" + envVar);\n                        }\n                    }\n                    return env;\n                }\n            },\n                    RunCommandActionResultBuildItem.class.getName(), DevServicesLauncherConfigResultBuildItem.class.getName());\n            if (target != null && !exists.get()) {\n                getLog().error(\"quarkus.run.target \" + target + \" is not found\");\n                return;\n            }\n            if (tooMany.get() != null) {\n                getLog().error(\n                        \"Too many installed extensions support quarkus:run.  Use -Dquarkus.run.target=<target> to choose\");\n                getLog().error(\"Extensions: \" + tooMany.get());\n            }\n        } finally {\n            // Clear all the system properties set by the plugin\n            propertiesToClear.forEach(System::clearProperty);","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/RunMojo.java#L142-L178","documentation":"RunMojo's envVarsAsMap function converts the configured environment-variable list into a Map before launching the dev-mode process. Each entry must contain '=' (split with limit 2, so values may contain '='). Entries without an '=' separator throw RuntimeException 'Invalid environment variable: <envVar>'.","triggerScenarios":"Configuring quarkus:dev `envVars` (or environmentVariables) with an entry lacking '=', e.g. <envVars>DEBUG</envVars> instead of DEBUG=true.","commonSituations":"Listing variable names expecting them to be inherited from the shell; copying shell `export FOO` syntax; typos dropping the '='; using spaces around the '=' which become part of the value.","solutions":["Give every entry an explicit value: DEBUG=true instead of DEBUG","Remember values may contain '=' (split uses limit 2), so KEY=a=b is valid","Inherit/export variables in the shell instead of the mojo config if you don't want to set them here","Trim whitespace: KEY = true creates key 'KEY ' — write KEY=true"],"exampleFix":"<!-- before -->\n<envVars>DEBUG,QUARKUS_LOG_LEVEL=DEBUG</envVars>\n<!-- after -->\n<envVars>DEBUG=true,QUARKUS_LOG_LEVEL=DEBUG</envVars>","handlingStrategy":"validation","validationCode":"// Validate env var entries before configuring quarkus:dev:\nfor (String e : envVars.split(\",\")) {\n  if (!e.contains(\"=\")) throw new IllegalArgumentException(\"Invalid environment variable: \" + e);\n}","typeGuard":null,"tryCatchPattern":"try { runMojo.execute(); }\ncatch (RuntimeException e) {\n  if (e.getMessage().startsWith(\"Invalid environment variable\")) {\n    log.error(\"Env var entries must be KEY=VALUE: {}\", e.getMessage());\n  } else throw e;\n}","preventionTips":["Give every configured env var an explicit value (KEY=true, not KEY)","Values may contain '=' (split limit 2) — safe for URLs/tokens","Avoid spaces around '=' in the mojo configuration","Prefer exporting vars in the shell over listing bare names in config"],"tags":["maven","quarkus","environment-variables"],"backgroundTag":"invalid-env-var-format","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}