Create a VPK
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.
Verify File Structure
Section link for Verify File StructureYour file structure must adhere to the following guidelines:
- Source files must be located under the
javasdkfolder 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.triggersorcustom.actions. - You can have no more than 1,000
.javasource 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
Create Manifest File
Section link for Create Manifest FileYour 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.
| Attribute | Description |
|---|---|
<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:
|
<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:
|
<description> | Optional: A description of your package. If omitted, the description will appear blank in Admin > Deployment > Inbound Packages. |
Deployment Options
Section link for Deployment Optionsincremental: 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 emptyjavasdkfolder, or if no such folder is included.