[ 
https://jira.codehaus.org/browse/MRELEASE-879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=346931#comment-346931
 ] 

Sergei Ivanov commented on MRELEASE-879:
----------------------------------------

I think for the time being, I'll have to pass the {{--toolchains}} option to 
the forked executions using the {{arguments}} parameter of the 
{{maven-release-plugin}}, but in a longer term it really needs to be handled by 
the plugin itself.

Not sure if the plugin needs any additional degree of control over the 
toolchains being passed to the forked Maven executions. After all, I believe 
that the Maven settings are passed on verbatim and there is currently no way 
(apart from perhaps the same {{arguments}} parameter) to alter that behaviour.

> Custom toolchain configuration is not passed to forked Maven executions
> -----------------------------------------------------------------------
>
>                 Key: MRELEASE-879
>                 URL: https://jira.codehaus.org/browse/MRELEASE-879
>             Project: Maven Release Plugin
>          Issue Type: Bug
>          Components: prepare-with-pom
>    Affects Versions: 2.5
>         Environment: Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000)
> Maven home: /opt/app/xxx/uat1/tools/apache-maven-3.0.4
> Java version: 1.7.0_07, vendor: Oracle Corporation
> Java home: /opt/app/xxx/uat/uat1/tools/jdk/32/jdk1.7.0_07/jre
> Default locale: en_US, platform encoding: ANSI_X3.4-1968
> OS name: "linux", version: "2.6.18-194.32.1.el5", arch: "i386", family: "unix"
>            Reporter: Sergei Ivanov
>
> We do use maven toolchains extensively, and recently we had to make a change 
> to pass a custom node-specific toolchain file to our release jobs. We can no 
> longer have a common toolchain file in {{~/.m2/}} directory, so we started 
> using {{--toolchain}} command line option instead.
> Unfortunately, this did not work well at all with the Maven release process. 
> It seems that the forked Maven executions (as spawned by {{release:prepare}} 
> and {{release:perform}} goals) do not inherit the custom toolchain 
> configuration from the release plugin execution.
> Quickly skimming through the release plugin sources, I could not see any 
> mention of toolchains either. 
> As far as I can tell, one would need to extend the {{ReleaseEnvironment}} to 
> pass toolchains file location to the forked Maven process. It should be 
> possible to extract the location of the toolchains file by calling 
> {{org.apache.maven.execution.MavenExecutionRequest.getUserToolchainsFile()}} 
> through Java reflection (in a similar way to what {{getActiveProfileIds()}} 
> method in {{org.apache.maven.plugins.release.AbstractReleaseMojo}} class 
> does). I believe {{--toolchains}} option was only introduced in Maven 3.0.4 
> and the {{getUserToolchainsFile()}} method may be missing in earlier versions 
> of Maven Core, in which case the release process should simply fall back to 
> the current behaviour.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to