Doing a deployment with ANT that includes some apex and a custom object. However, when I test deploy I’m getting errors about fields not being in the package.xml. Has something changed with the package.xml validation?
Error Message (snippet)
[sf:deploy] 1. objects/MyObject__c.object (MyObject__c.MyField__c) -- Error: Not in package.xml
Package XML (snippet)
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>MyObject__c</members> <name>CustomObject</name> </types> <version>29.0</version> </Package>
A full-ish redacted package.xml, custom object, and deployment log are available in this gist.
The deployment included several apex classes, triggers, and custom objects. Strangely thought if you look at the deployment log the error happens in the “Processing Custom Objects” phase.
In any event, deploying just the custom object succeeds. But for the sake of the next guy hopefully we can get some clarity on why this would happen.
Possible Cause – Case Sensitive package.xml validation?
Ran into this a second time with just a single field deployment. Field was retrieved successfully, but on deployed returned the same error. Correcting the package.xml to match the exact case of the field name led to a successful deployment. Upon re-inspection of the initial deployment I noticed that the my package.xml wasn’t using the same case as the actual object API name.
It appears that the deploy package to package.xml validation is case sensitive. If you get a is not in package.xml, double check the case of the object or field in your package.xml.
The tricky part about this is that
ant retrieve will work just fine, the validation only occurs when doing
ant deploy or