Description of problem: When force clean build marker is used all the content along with the settings.xml from .m2 directory of the gear is deleted as seen from the code: ~~~ if force_clean_build_enabled_for_latest_deployment; then echo "force_clean_build marker found; removing Maven dependencies." rm -rf ${OPENSHIFT_HOMEDIR}.m2/* ${OPENSHIFT_HOMEDIR}.m2/.[^.]* fi ~~~ Also, if we configure global maven settings.xml file as mentioned in this article : https://access.redhat.com/solutions/535653 and then create a new gear the .m2 directory for the gear is populated with a copy of /etc/openshift/skel/.m2/settings.xml and everything works as expected. When we enable force clean build, the settings.xml file gets deleted along with the repository that gets created after downloading the dependencies and the next build results in fail. Version-Release number of selected component (if applicable): 2.2 How reproducible: Always Steps to Reproduce: 1.Configure global maven settings.xml file as mentioned in this article : https://access.redhat.com/solutions/535653 2.Create a new gear having jboss cartridge 3.Enable force clean build Actual results: The settings.xml file gets deleted along with the repository directory after enabling the force clean build Expected results: The settings.xml file shouldn't be deleted along with the repository directory after enabling the force clean build Additional info: The next time when a build is performed the settings.xml file from skel directory must be copied to the .m2 directory. OR In short the rm line in the code should be replaced with something like: ~~~ if force_clean_build_enabled_for_latest_deployment; then echo "force_clean_build marker found; removing Maven dependencies." rm -rf ${OPENSHIFT_HOMEDIR}.m2/* ${OPENSHIFT_HOMEDIR}.m2/.[^.]* ## Replace with: find ${OPENSHIFT_HOMEDIR}.m2/ -type f -not -name 'settings.xml' -delete fi ~~~
Verified on puddle 2.2/2015-01-23.2. 1. Configure to use global maven settings.xml following https://access.redhat.com/solutions/535653 2. Create a jbosseap app, check the settings.xml exists under ${OPENSHIFT_HOMEDIR}.m2 after ssh to app 3. Touch .openshift/markers/force_clean_build marker and git push this change. 4. The settings.xml under ${OPENSHIFT_HOMEDIR}.m2 is still there. 5. This also works well for jbossews-1.0 and jbossews-2.0 cartridge.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-0220.html