How to use the retrievePkg with the Force Migration Tool?

I am trying to do some prototyping with the ANT force migration tool, my initial goal is to be able to download a package and then tag that release. The issue I am having is that the name of the package is not being accepted even though the package exists on our development org.

$: ant retrievePkg
Buildfile: build.xml

retrievePkg:
[sf:retrieve] Request for a retrieve submitted successfully.
[sf:retrieve] Request Id for the current retrieve task: 04sE0000000zn36IAA
[sf:retrieve] Waiting for server to finish processing the request...
[sf:retrieve] Request Status: Error

BUILD FAILED
build.xml:30: Failed to process the request successfully. Cause(UNKNOWN_EXCEPTION): INVALID_CROSS_REFERENCE_KEY: No package named '<Package>' found

This is the contents of the build XML

<target name="retrievePkg">
      <sf:retrieve username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" retrieveTarget="retrieveOutput" packageNames="<Package>"/>
    </target>

How would I determine valid names for packages within the org?

Answer

I don’t believe there is a method to pull down a list of all available packages, but you should be able to use a known name by navigating to Setup -> App Setup -> Installed Packages and using the value in the “Package Name” column (including any spaces in the name). I just confirmed this with several of our installed packages.

Attribution
Source : Link , Question Author : ebt , Answer Author : JCD

Leave a Comment