+++ This bug was initially created as a clone of Bug #1176507 +++ 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 ~~~ --- Additional comment from RHEL Product and Program Management on 2014-12-22 02:57:30 EST --- Since this issue was entered in bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/70ed80147c4043a669f9b99ab47e0472aaeb105f BUG 1176970: Delete all dependencies except settings.xml
Now the settings.xml file will be preserved even if the force clean build marker will be added.
Verified on devenv_5381. 1. Configure to use global maven settings.xml with below steps: # mkdir -p /etc/openshift/skel/.m2/ # cp $(rpm -ql $(rpm -qa | grep maven) | grep settings.xml) /etc/openshift/skel/.m2/ 2. Create a jboss app,here I have tested with jbosseap-6, jbossas-7, jbossews 1. and 2.0 3. Check the settings.xml exists under ${OPENSHIFT_HOMEDIR}.m2 after ssh to app 4. touch .openshift/markers/force_clean_build 5. Push changes 6. Check the settings.xml still exists.