Skip to content

Commit

Permalink
[MRELEASE-851] javaHome parameter is ignored and inherited unexpectedly
Browse files Browse the repository at this point in the history
This closes #182
  • Loading branch information
mkampmey authored and michael-o committed Apr 20, 2023
1 parent 5d3f9b7 commit f96c6bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void executeGoals(
// fix for MRELEASE-1105
// .addShellEnvironment( "MAVEN_DEBUG_OPTS", "" )
.setBatchMode(true)
.setJavaHome(releaseEnvironment.getJavaHome())
.setOutputHandler(getLogger()::info)
.setErrorHandler(getLogger()::error);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public abstract class AbstractReleaseMojo extends AbstractMojo {
private File mavenHome;

/**
* The {@code JAVA_HOME} parameter to use for forked Maven invocations.
* The Java home parameter to use for forked Maven invocations.
*
* @since 2.0-beta-8
*/
Expand Down

0 comments on commit f96c6bc

Please sign in to comment.