What if I want all the classes EXCEPT a few?

For example, if I have a scheduled batch that definitely won't deploy, how would I say "not that" but not have to manually name all the other ones?

Caveats...this is via Jenkins GitHub plugin,, not mavens or eclipse.

  • I'm not sure there is anything you can do via the package.xml itself, but perhaps you can script something to automate a package.xml creation with metadata references and exclude the ones you know you can't deploy. Jan 4, 2014 at 19:46

1 Answer 1


Unfortunately ant migration tool does not look at includes / excludes attributes or elements.

If it's a regular thing, how about using ant to snip it out of your package.xml on the fly?

<target name="almostDeploy">
    <!-- put yo stuff away -->
    <replace file="src/package.xml"
    value="&lt;!--members&gt;YOUR_CLASS_HERE&lt;/members--&gt;" />

    <!-- normal salesforce deploy -->

    <!-- put stuff back yo -->
    <replace file="src/package.xml"
    value="&lt;members&gt;YOUR_CLASS_HERE&lt;/members&gt;" />
  • 2
    Nice tweak! To get use of the Ant exclude/include filters back one could copy files to be deployed to a temp folder using the filters and leverage wildcards in the package.xml as well. Bit more work then your nice use of replace above, but maybe a thought if the requirement grows more complex. Jan 5, 2014 at 23:18
  • Very clever, 320. You're the winner. Jan 6, 2014 at 16:05

You must log in to answer this question.

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