apache/maven · error · IllegalStateException
local mode requires maven.home Java System Property set
Error message
local mode requires maven.home Java System Property set
What it means
Error "local mode requires maven.home Java System Property set" thrown in apache/maven.
Source
Thrown at impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/BaseParser.java:291
Path result = getCanonicalPath(context.parserRequest.cwd());
context.systemPropertiesOverrides.put("user.dir", result.toString());
return result;
} else {
Path result = getCanonicalPath(Paths.get(System.getProperty("user.dir")));
mayOverrideDirectorySystemProperty(context, "user.dir", result);
return result;
}
}
protected Path getInstallationDirectory(LocalContext context) {
if (context.parserRequest.mavenHome() != null) {
Path result = getCanonicalPath(context.parserRequest.mavenHome());
context.systemPropertiesOverrides.put(Constants.MAVEN_HOME, result.toString());
return result;
} else {
String mavenHome = System.getProperty(Constants.MAVEN_HOME);
if (mavenHome == null) {
throw new IllegalStateException(
"local mode requires " + Constants.MAVEN_HOME + " Java System Property set");
}
Path result = getCanonicalPath(Paths.get(mavenHome));
mayOverrideDirectorySystemProperty(context, Constants.MAVEN_HOME, result);
return result;
}
}
protected Path getUserHomeDirectory(LocalContext context) {
if (context.parserRequest.userHome() != null) {
Path result = getCanonicalPath(context.parserRequest.userHome());
context.systemPropertiesOverrides.put("user.home", result.toString());
return result;
} else {
Path result = getCanonicalPath(Paths.get(System.getProperty("user.home")));
mayOverrideDirectorySystemProperty(context, "user.home", result);
return result;
}View on GitHub (pinned to e4093d4e12)
When it happens
Trigger: Thrown at impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/BaseParser.java:291 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/a8d6d79894cd70b3.
Report an issue: GitHub.