diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/ForkedMavenExecutor.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/ForkedMavenExecutor.java index 2b8d9f62..7a807aaf 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/ForkedMavenExecutor.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/ForkedMavenExecutor.java @@ -106,6 +106,10 @@ public void executeGoals( cl.addEnvironment("MAVEN_TERMINATE_CMD", "on"); + if (releaseEnvironment.getJavaHome() != null) { + cl.addEnvironment("JAVA_HOME", releaseEnvironment.getJavaHome().getAbsolutePath()); + } + if (settingsFile != null) { cl.createArg().setValue("-s"); cl.createArg().setFile(settingsFile);