Skip to content

Before you can create your VPK, you must verify that your source code is in the proper file structure and prepare a valid vaultpackage.xml manifest file. This manifest file tells Vault whether you’re adding, replacing, or removing code.

Create a VPK by zipping your javasdk folder and the vaultpackage.xml manifest file and renaming it with the .vpk extension. For more detailed instructions, see Getting Started.

Your file structure must adhere to the following guidelines:

  • Source files must be located under the javasdk folder in a maven project directory hierarchy as follows: src.main.java.com.veeva.vault.custom
  • Source files may be located in any number of arbitrarily named subpackage folders under custom. For example, custom.triggers or custom.actions.
  • You can have no more than 1,000 .java source files or 50MB of data in a single deploy. If you have more than 1,000 source files or a VPK larger than 50MB, the entire deploy will fail.
  • The following files are ignored:
    • Any files not in the structure defined above
    • Any files without the .java extension

Your manifest file must be named vaultpackage.xml and must be located in the root of your file structure.

Example vaultpackage.xml:

<vaultpackage xmlns="https://veevavault.com/"> <name>PKG-DEPLOY</name> <source> <vault></vault> <author>mmurray@veepharm.com</author> </source> <summary>PromoMats RecordTrigger</summary> <description>Record trigger on the Product object for PromoMats.</description> <javasdk> <deployment_option>incremental</deployment_option> </javasdk> </vaultpackage>

All of the following attributes must appear in the manifest file. Attributes marked as Optional must still be included, but can be left with a blank value.

AttributeDescription
<vaultpackage>Top-level attribute to hold all other attributes. Must include xmlns="https://veevavault.com/".
<name>A name which identifies this package.
<source>A top-level attribute to hold the following sub-attributes:
  • <vault>: Optional: We recommend leaving this blank. This is the Vault ID of the source Vault, but because you are importing this VPK, this attribute is ignored. When you export a VPK from Vault, this field is automatically populated with the source Vault ID.
  • <author>: The Vault user name of the user who created this package.
<summary>Provide more information about this package. Appears in the Summary section of Admin > Deployment > Inbound Packages.
<javasdk>A top-level attribute to hold the <deployment_option> sub-attribute. This tells Vault how to deploy your package in Vaut. Valid values are:
  • incremental
  • replace_all
  • delete_all
Learn more in the Deployment Options section.
<description>Optional: A description of your package. If omitted, the description will appear blank in Admin > Deployment > Inbound Packages.
  • incremental: Add new or update existing code in the target Vault. This will never delete source files from the target Vault, but it may overwrite existing files.
  • replace_all: Completely delete all existing source code in the target Vault and replace it with the code in this VPK. This may permanently delete source files from the target Vault.
  • delete_all: Delete all of the existing source files in the target Vault. This setting only works if the VPK contains an empty javasdk folder, or if no such folder is included.