VLT Pack and VLT

Project Structure at a glance

[basedir]
+- src/main/content/
|  +- jcr_root/             # jcr_root contains repository content like jsp and .content.xml files
|  \- META-INF/vault/
|     \- filter.xml         # the META-INF/vault/filter.xml defines the package Workspace Filter
\- pom.xml

Keeping your vlt workspace under src/main/content is merely a convention. It is possible to specify any directory containing the jcr_root and META-INF/vault paths in your pom.xml using a <resource> element, just so long as the jcr_root and META-INF folders wind up in target/classes by the time the package lifecycle phase starts.

Create a new vltpack project

First start with a basic vltpack pom.xml as described on the Usage page. Notice that it has added the src/main/content path as a resource root for the maven-resources-plugin. This will be the root of your vlt working copy. Create the src/main/content directory if it doesn't exist.

Create your Workspace Filter

It's generally not a good idea to try to checkout the entire repository for simple package project, so you should specify your desired package Workspace Filter first, so that the vlt checkout command can be executed faster and more reliably.

First, create the META-INF/vault directory under src/main/content, then create a filter.xml file under META-INF/vault with the following basic structure:

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/apps/myApp" />
    <filter root="/etc/designs/myApp" />
</workspaceFilter>
                

Check out your vlt workspace

Next, you will checkout your application code into the src/main/content directory. Make sure you have followed Adobe's instructions for installing VLT .

With VLT installed and your CQ server running at localhost:4502, open a terminal window and navigate to your project directory. Then execute the following command:

vlt --credentials admin:admin checkout http://localhost:4502/crx src/main/content