Using ANT_OPTS in an Ant-type build definition?
Hello,
We are using RTC 3.0.1. We are launching builds with a build definition that uses Ant. We need specific Ant options to avoid OutOfMemoryExceptions.
On the build server, the JBE process has an ANT_OPTS environment variable (we see it in the java process environment with the command ps e www -C java). However, when we submit a build request, the ANT_OPTS env var is overwritten by the value of the "Java VM arguments" field set in the build defintion's Ant tab.
This is true even if this field is empty.
My question is: Is there a way to force the JBE-launched Ant to use a ANT_OPTS value other than what's passed in the build definition?
Thank you,
--Fred Mora
We are using RTC 3.0.1. We are launching builds with a build definition that uses Ant. We need specific Ant options to avoid OutOfMemoryExceptions.
On the build server, the JBE process has an ANT_OPTS environment variable (we see it in the java process environment with the command ps e www -C java). However, when we submit a build request, the ANT_OPTS env var is overwritten by the value of the "Java VM arguments" field set in the build defintion's Ant tab.
This is true even if this field is empty.
My question is: Is there a way to force the JBE-launched Ant to use a ANT_OPTS value other than what's passed in the build definition?
Thank you,
--Fred Mora
2 answers
Hello,
We are using RTC 3.0.1. We are launching builds with a build definition that uses Ant. We need specific Ant options to avoid OutOfMemoryExceptions.
On the build server, the JBE process has an ANT_OPTS environment variable (we see it in the java process environment with the command ps e www -C java). However, when we submit a build request, the ANT_OPTS env var is overwritten by the value of the "Java VM arguments" field set in the build defintion's Ant tab.
This is true even if this field is empty.
My question is: Is there a way to force the JBE-launched Ant to use a ANT_OPTS value other than what's passed in the build definition?
Thank you,
--Fred Mora
Hi,
You need to put the values of your ANT_OPTS in the 'Java VM arguments' field in the build definition (ex. enter '-Xms64m -Xmx256m' in the input field). ANT_OPTS is an environment variable used by Ant's bat/shell scripts. The JBE does not use the bat/shell script to invoke Ant, but rather invokes it by executing java with the Ant launcher.
Brent Ulbricht
RTC Build Lead
Hi,
You need to put the values of your ANT_OPTS in the 'Java VM arguments' field in the build definition (ex. enter '-Xms64m -Xmx256m' in the input field). ANT_OPTS is an environment variable used by Ant's bat/shell scripts. The JBE does not use the bat/shell script to invoke Ant, but rather invokes it by executing java with the Ant launcher.
Brent Ulbricht
RTC Build Lead
Brent,
Thank you, what you describe is consistent with what we see. I solved our current OoME problem by adding the requisite options to each of the impacted build definitions.
From a design standpoint, this is not very good. People who maintain build definitions don't necessarily have the build system skills needed to decide on Ant options.
I suggest a more flexible feature: if the 'Java VM arguments' field is empty, the JBE should read the value of the system-defined ANT_OPTS (or some other documented variable or property defined on the machine running JBE) and pass it to Ant when it is invoked.
I'd like to see this in an upcoming version of RTC.
Unless you see a strong argument against this suggestion, please kindly create a work item to this effect and subscribe me to it.
Thank you,
--Fred Mora