The Ant Migration Tool is retired with Spring ’24. The tool continues to function as-is for future API versions but isn’t updated with new functionality and isn’t supported. If Salesforce adds a new feature that is incompatible with Ant, the Ant Migration Tool won’t be updated to support it. To manage metadata changes, switch to Salesforce CLI for a modern, supported developer experience.
Note
The package.xml file is a project manifest that lists all the components you want to retrieve or deploy in a single request. You can retrieve or deploy only a single package at a time.
The following elements may be defined in package.xml:
Name
Description
<fullName>
The name of the server-side package to deploy into. If the <fullName> field is omitted, components will not be assigned to a package when deployed, and will be in the unpackaged package. This field is not used for retrieve.
<types>
This element contains one or more <members> tags and one <name> tag, and is used to list the metadata components of a certain type to retrieve or deploy.
<members>
The full name of a component. There is one <members> element defined for each component in the directory. You can replace the value in this member with the wildcard character * (asterisk) instead of listing each member separately. This is a child element of <types>.
<name>
Contains the type of the component, for example CustomObject or Profile. There is one name defined for each component type in the directory. This is a child element of <types>.
<version>
The Metadata API version number of the files being retrieved or deployed. When deploying, all the files must conform to the same version of the Metadata API.
To retrieve standard objects and/or custom fields on standard objects, you must name the component in package.xml. The following package.xml file will retrieve a single field EngineeringReqNumber__c, on the Case object, as well as the entire Account object.
The listMetadata target retrieves property information about your metadata components.This target is useful to identify individual components in package.xml for a retrieval or a high-level view of particular metadata types. For example, you can use this target to return a list of names of all your CustomObject or Layout components. Then use the information retrieve a subset of the components.