Wondering if anyone has experience tweaking the manifest XML file to disclude certain Apex Classes being pulled into Visual Studio Code. I know you can use the * as a wildcard to include certain groups of similarly named apex classes but i want to disclude groups of similarly named apex classes. Does anyone know the syntax to do so? These apex classes i want to disclude are all from apps downloaded from the app exchange (managed packages)


I don't think what you want to achieve is possible simply using a wildcard pattern in a package.xml.

From my understanding the package.xml only has two ways of formulating inclusion: either a wildcard for metadata types that support the wildcard - which then includes all instances of that metadata type (some special cases excluded like for type CustomObject does really get all custom object but none of the standard objects) or list each instance of a metadata type individually. This behaviour is also true for ApexClasses. Similarly the command line options of sfdx force:source:retrieve also allow you to retrieve all instances of a metadata type, e.g. sfdx force:source:retrieve -m ApexClass would retrieve all ApexClasses or the explicitly listed instances of a metadata type.

Neither the package.xml nor the commandline options of sfdx allow to exclude instances of metadata types, a wildcard really means all (well, special cases not considered) and can not be used to build a pattern of names to include (i.e. *Controller of type ApexClass).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.