[
https://jira.codehaus.org/browse/MSHARED-261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Scholte reassigned MSHARED-261:
--------------------------------------
Assignee: Robert Scholte
> DefaultInvoker does not set M2_HOME
> -----------------------------------
>
> Key: MSHARED-261
> URL: https://jira.codehaus.org/browse/MSHARED-261
> Project: Maven Shared Components
> Issue Type: Bug
> Components: maven-invoker
> Environment: * Win7 x64
> * JDK 6
> Reporter: Bernd Vogt
> Assignee: Robert Scholte
> Attachments: maven-invocation-its.zip
>
>
> *Problem:*
> Recently, some of our releases failed because the maven-release-plugin has
> not re-used the Maven installation with which it was launched to perform the
> actual release goals. It was noticeable that the release plugin has used the
> Maven installation where the M2_HOME variable of the current machine has
> pointed to...
> After some investigation, I figured out, that the DefaultInvoker doesn't
> propagate the Maven home directory to the M2_HOME env var of invoked Maven
> processes but uses the mvn.bat of those Maven. The problem ist, that mvn.bat
> at first looks-up for M2_HOME to launch the Maven which is located there...
> So, if M2_HOME is already set this takes effect and not the Maven where the
> invoked mvn.bat is contained in...
> *Workaround for release problem:*
> Configure release plugin to use the Maven executor 'forked-path' instead of
> 'invoke'
> *Workaround when using Invoker:*
> {{request.addShellEnvironment("M2_HOME",
> invoker.getMavenHome().getAbsolutePath());}}
> *Steps to reproduce:*
> # Download and unzip attached test project
> # cd to unzipped folder and {{mvn clean verify}}
> # Take a look at contained {{DefaultInvokerIT}}
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)