MAVEN_OPTS

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

MAVEN_OPTS

Nord, James
Hi all,
 
It seems hudson isn't setting MAVEN_OPTS and so any maven build that forks[1] can end up with an O.O.M.Ex.
From what I can see the MAVEN_OPTS is set on the command line to java but the environment variable isn't set, so if maven forks it won't know about the opts and will then invoke java without the custom options (extra heap) etc and then possible cause the build to fail.
 
I've implemented a workaround[2] in the m2Release plugin that adds a new variable in Environment.buildEnvVars(Map evn) - but this should really be in the core so it available to all maven builds that fork.
 
/James
 
[1]http://maven.apache.org/shared/maven-invoker/
[2]https://hudson.dev.java.net/issues/show_bug.cgi?id=3644

**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the [hidden email] and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: MAVEN_OPTS

Kohsuke Kawaguchi
Administrator
Fixed for 1.315.

Nord, James wrote:

> Hi all,
>  
> It seems hudson isn't setting MAVEN_OPTS and so any maven build that
> forks[1] can end up with an O.O.M.Ex.
>>From what I can see the MAVEN_OPTS is set on the command line to java
> but the environment variable isn't set, so if maven forks it won't know
> about the opts and will then invoke java without the custom options
> (extra heap) etc and then possible cause the build to fail.
>  
> I've implemented a workaround[2] in the m2Release plugin that adds a new
> variable in Environment.buildEnvVars(Map evn) - but this should really
> be in the core so it available to all maven builds that fork.
>  
> /James
>  
> [1]http://maven.apache.org/shared/maven-invoker/
> [2]https://hudson.dev.java.net/issues/show_bug.cgi?id=3644
>
> **************************************************************************************
> This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the [hidden email] and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
>
> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
> **************************************************************************************
>

--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/

smime.p7s (4K) Download Attachment