Newer Version Available
Retrieving Managed or Unmanaged Packages
Packages are useful for distributing related bundles of metadata across multiple instances or organizations, via Lightning Platform AppExchange. However, you can use the Ant Migration Tool to freely retrieve and deploy packaged metadata without using AppExchange. You retrieve both managed and unmanaged packages in the same way.
To retrieve a package, specify a packageNames parameter in the build.xml file. For example:
1<target name="retrieveNamedPackage">
2 <sf:retrieve
3 username="${sf.username}"
4 password="${sf.password}"
5 sessionId="${sf.sessionId}"
6 serverurl="${sf.serverurl}"
7 retrieveTarget="projectFolder"
8 packageNames="mySourcePackage"/>
9</target>