I'm trying to deploy an Apex Class from one org to another. I get this error:
All Component Failures:
1.package.xml — Error: No package.xml found
package.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Test1234</members>
<name>ApexClass</name>
</types>
<version>33.0</version>
</Package>
build.properties
# build.properties
## Specify the login credentials for the desired Salesforce organization sf.username = sf.password =
#sf.pkgName =
#sf.zipFile =
#sf.metadataType =# Use 'https://login.salesforce.com' for production or developer edition (the default if not specified).
# Use 'https://test.salesforce.com for sandbox.sf.serverurl = https://login.salesforce.com sf.maxPoll = 20
# If your network requires an HTTP proxy, see http://ant.apache.org/manual/proxy.html for configuration.
#
build.xml file
<project name="Jenkins CI Demo" xmlns:sf="antlib:com.salesforce">
<property file="C:\TestDeploy\build.properties"/>
<property environment="env"/>
<target name="deploy">
<sf:deploy username="${sf.username}"
password="${sf.password}"
serverurl="${sf.serverurl}"
maxPoll="${sf.maxPoll}"
logType="Detail"
deployRoot="C:\TestDeploy\src\"/>
</target>
</project>
Best Answer
The
package.xml
file must be at yourdeployRoot
("C:\TestDeploy\src\package.xml
"). It must be exactly namedpackage.xml
(case sensitive). The format of your metadata source directory should look like this:Edit:
It seems that you also need to use
singlePackage
in order for the structure above to work:It seems it may have been "false" by default before, or maybe it's just been too long since I've used it, but when singlePackage is false, it specifies an extra layer in your file system, like this: