Bug 1033673

Summary: Unable to customize MAVEN_OPTS
Product: OpenShift Online Reporter: Chris Ryan <cryan>
Component: ImageAssignee: Ben Parees <bparees>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: bmeng, bparees, chunchen, dmace
Target Milestone: ---Keywords: UpcomingRelease
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-30 00:50:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Chris Ryan 2013-11-22 15:20:53 UTC
Description of problem:
A user is not able to change the default value of MAVEN_OPTS, for example, from MAVEN_OPTS=-Xmx384m to MAVEN_OPTS=-Xmx512m

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Create a jbossas-7 app
2. Create .openshift/action_hooks/pre_build_jbossas-7 
3. In this file, add
export MAVEN_OPTS="-Xmx512m"
export MAVEN_ARGS="clean package -Popenshift -DskipTests --debug"
4. git commit/push the changes

Actual results:
The env output shows 
MAVEN_OPTS=-Xmx384m

Expected results:
The env output should show
MAVEN_OPTS=-Xmx512m

Additional info:
This could be related to:
https://bugzilla.redhat.com/show_bug.cgi?id=868053

Comment 1 Ben Parees 2014-01-16 16:09:53 UTC
PR: https://github.com/openshift/origin-server/pull/4486

Comment 2 openshift-github-bot 2014-01-17 02:11:47 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/c886c189aa70a40a587bd4734eb2e8cf0b7eda31
Bug 1033673 - Unable to customize MAVEN_OPTS

Comment 3 chunchen 2014-01-17 06:20:54 UTC
Checked on devenv_4236, the issue is reproduced, please refer to the following results:

1. Create a jbossas-7 app
rhc app create cas00 jbossas-7
2. Create .openshift/action_hooks/pre_build_jbossas-7 
3. In this file, add
export MAVEN_OPTS="-Xmx512m"
export MAVEN_ARGS="clean package -Popenshift -DskipTests --debug"
4. git commit/push the changes
5. Check the value of MAVEN_OPTS variable
]$ rhc ssh cas00 'env | grep MAVEN'
SSH_ORIGINAL_COMMAND=env | grep MAVEN

Comment 4 Ben Parees 2014-01-17 14:40:11 UTC
The behavior is not supposed to permanently alter the environment variable of the gear, it is only supposed to alter the arguments passed to the maven invocation during the build, so you need to watch the output of the maven command during the build process to see that the -Xmx argument is correct:



remote: [DEBUG] properties used {java.vendor=Oracle Corporation, sun.java.launch
<output trimmed>
env.MAVEN_OPTS=-Xmx512m

Comment 5 Chris Ryan 2014-01-17 15:51:52 UTC
Just tested this against devenv_4236 (ami-b5f0c3dc), and the fix in Comment 1 works for this devenv.