I am in the process of setting up version control and automated builds using Git and ANT and eventually we might setup Jenkins for continuous integration.

My plan is to utilize Git branches by developers for each feature development and test it in their own sandbox and merge it back to Master branch and from there, we would use ANT for deploying to other environments.

However one question that stuck me is, How to build package.xml? One developer might have modified just an Apex class and other might have modfied a just a visualforce page. Should I manually build the package.xml? I think manual approach is tedious and error prone. I have been reading through several articles on this topic and somebody suggested using a script to generate paackage.xml based on modified files. Not sure that is a good idea. Anyway I wanted to get your thoghts on this.

Would really appreciate your feedback and Thanks.

  • I was thinking rather than deploying changed components only, let us deploy everything from the Master(I meant latest from Master branch). In that way, I don't have to worry about package.xml all the time and Just create it once by including all components. I might have to periodically update it though. Any thoughts on this approach rather deploying only changed components?
    – sdondeti
    Nov 6, 2015 at 16:54

1 Answer 1


If you are using jenkins you can write a Shell script .

The below is starter blog that i have found success with Jenkins multiple times when setting the flow for the client .


If you have cummulus set up with your git flow you can use below from salesforce foundation


Also you can also use ANT as highlighted in the below article


  • Thanks Mohit. I did go through the above URLs earlier. CumulusCI is mainly for building for packages and i think it applies to regular development as well to some extent. In CumulusCI, I think they are deploying all components all the time since it is a package. I am looking for a solution for regular single org development and deploying only modified components.
    – sdondeti
    Nov 6, 2015 at 1:52
  • I shared the kevins blog and that has how to do it incrementally as well.. Nov 6, 2015 at 1:55
  • Yes. I saw kevins blog. I think the only problem with Kevin's approach is, what happens If a build fails and somebody else commits different files in the mean time. it would pickup only latest files and the earlier one gone. I could be wrong on this but that is what I thought of after reading the blog. I decided to make the process a bit simple. Let us deploy everything from Master branch anytime there is a change. Not sure any issue with this approach. Any thoughts?
    – sdondeti
    Nov 6, 2015 at 17:00
  • is there any way to create package.xml dynamically only for changed/modified file and deploy accordingly using Jenkins/CI ? Feb 1, 2017 at 9:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .