Skip to content

In this step, you will:

  • Deploy custom code to your Vault
  • Learn how to install & use the Vault Java SDK Maven Plugin to deploy code
  • Run your deployed code in your Vault

If you're using IntelliJ®, Maven is already bundled with your installation. If you're using another IDE, you may need to manually install Maven.

  1. Navigate to vsdk-helloworld-getting-started\src\main\resources and open plugin_settings_file.json.
  2. Replace firstname.lastname@example.com with your Vault user name.
  3. Navigate to vsdk-helloworld-getting-started\src\main\resources and open vapil_settings_file.json.
  4. Update the vaultUsername, vaultPassword, and vaultDNS values with your login information.
  5. From the righthand IntelliJ® sidebar, open the Maven menu and navigate to vsdk-hellowork > Plugins > vaultjavasdk.
  6. Double click on the vaultjavasdk:package Maven goal. This creates the .vpk file which contains your code changes.
    Executing the vaultjavasdk:package Maven goal.Executing the vaultjavasdk:package Maven goal.
  7. Verify that this maven goal created a deployment folder at the root directory, with a vaultpackage.xml file and a .vpk file.
    The deployment folder in IntelliJ.The deployment folder in IntelliJ.
  8. Run the vaultjavasdk:deploy Maven goal from the Maven sidebar menu to deploy the .vpk to Vault. Deploying may take a minute. You will receive an email when Vault completes the deployment.

Now that we’ve deployed the new trigger code for the AFTER_INSERT event, let’s run it again and make sure that the changes work as expected.

  1. Log in to your Vault.
  2. Navigate to Business Admin > Objects > vSDK Hello World.
  3. Click Create.
  4. Enter someone else’s name in the Name field.
  5. Click Save. This time, your trigger fires on the AFTER_INSERT event and we’re getting an error message!
    Error message after firing the trigger on AFTER_INSERT.Error message after firing the trigger on AFTER_INSERT.

When saving records using Vault Java SDK, you must specify an error handling strategy. Because the AFTER_INSERT event is saving the record, writing code for this event requires an error handling strategy. You can learn more about error-handling and how to fix this error in the next tutorial: SDK Debugger.

Congratulations, you’ve finished the Getting Started!

To recap what we’ve learned, you now know how to: