Managing Packages Using Maven

You are reading the Adobe Experience Manager 5.6.1 version of Managing Packages Using Maven.
This documentation is also available for the following versions: Adobe Experience Manager 6.0  AEM 5.6  CQ 5.5 

Use the Content Package Maven plugin to integrate package management tasks into your Maven projects. The plugin goals and parameters enable you to automate many of the tasks that you would normally perform using the Package Manager page or the FileVault command line:

  • Create new packages from files in the file system.
  • Install and uninstall packages on the CRX or CQ server.
  • Build packages that are already defined on the server.
  • Obtain a list of packages that are installed on the server.
  • Remove a package from the server.

Adding the Content Package Maven Plugin to the POM File

To use the Content Package Maven Plugin, add the following plugin element inside the build element of your POM file:

<plugin>
	<groupId>com.day.jcr.vault</groupId>
	<artifactId>content-package-maven-plugin</artifactId>
	<version>0.0.20</version>
	<configuration>
	      <!-- parameters and values common to all goals, as required --> 
	</configuration>
</plugin>
        

To enable Maven to download the plugin, use the profile provided in the Obtaining the Content Package Maven Plugin section on this page.

Goals of the Content Package Maven Plugin

The goals and goal parameters that the Content Package plugin provides are described in the sections that follow. Parameters that are described in the Common Parameters section can be used for most of the goals. Parameters that apply to one goal are described in the section for that goal.

Plugin Prefix

The plugin prefix is content-package. Use this prefix to execute a goal from the command line, as in the following example:

mvn content-package:build 
        

Parameter Prefix

Unless otherwise noted, the plugin goals and parameters use the vault prefix, as in the following example:

mvn content-package:install -Dvault.targetURL="http://192.168.1.100:4502/crx/packmgr/service.jsp"
        

Proxies

Goals that use proxies for the CRX or CQ server use the first valid proxy configuration found in the Maven settings. If no proxy configuration is found, no proxy is used. See the useProxy parameter in the Common Settings section.

Common Parameters

The parameters in the following table are common to all goals except when noted in the Goals column.

Name Type Required Default Value Description Goals
failOnError boolean No false A value of true causes the build to fail when an error occurs. A value of false causes the build to ignore the error. All goals except package.
name String build: Yes
install: No
rm: Yes
Build: No default.
install: The value of the artifactId property of the Maven project.
The name of the package to act on. All goals except ls.
password String Yes admin The password used for authentication with the CRX server. All goals except package.
serverId String No The server ID from which to retrieve the user name and password for authentication. All goals except package.
targetURL String Yes http://localhost:4502/
crx/packmgr/
service.jsp
The URL of the HTTP service API of the CRX package manager. All goals except package.
timeout int No 5 The connection timeout for communicating with the package manager service, in seconds. All goals except package.
useProxy boolean No true Determines whether to use proxy configurations from the Maven settings file. A value of true causes the use of the first active proxy configuration found to proxy requests to the package manager. A value of false causes no proxy to be used. All goals except package.
userId String Yes admin The user name to authenticate with the CRX server. All goals except package.
verbose boolean No false Enables or disables verbose logging. A value of true enables verbose logging. All goals except package.

build

Builds a content package that is already defined on a CRX or CQ5 server.

Note

This goal does not need to be executed within a Maven project.

Parameters

All paramaters for the build goal are described in the Common Parameters section.

Example

The following example builds the workflow-mbean package that is installed on the CQ server with the IP address 10.36.79.223. The goal is executed using the followng command:

mvn content-package:build
        

The following POM file is located in the current directory of the command line tool. The POM specifies the package name and the URL of the package service.

<project xmlns="http://maven.apache.org/POM/4.0.0" 
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
		xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.adobe.example</groupId>
  <artifactId>example-package</artifactId>
  <version>0.0.1-SNAPSHOT</version>
    <build>
        <plugins>
	    <plugin>
		<groupId>com.day.jcr.vault</groupId>
		<artifactId>content-package-maven-plugin</artifactId>
		<version>0.0.20</version>
		<configuration>
			<name>workflow-mbean</name>
			<failOnError>true</failOnError>
			<targetURL>http://10.36.79.223:4502/crx/packmgr/service.jsp</targetURL>
		</configuration>
	    </plugin>
	</plugins>
    </build>
</project>
        

install

Installs a package in the CRX respository. Execution of this goal does not require a Maven project. The goal is bound to the Install phase of the Maven build lifecycle.

Parameters

In addition to the following parameters, see the descriptions in the Common Parameters section.

Name Type Required Default Value Description
artifact String No The value of the artifactId property of the Maven project. A string of the form groupId:artifactId:version[:packaging].
artifactId String No The ID of the artifact to install
groupId String No The groupId of the artifact to install
install boolean No true Determines whether to unpack the package automatically when it is uploaded. A value of true unpacks the package, and false does not unpack the package.
localRepository org.apache.maven.
artifact. repository.
ArtifactRepository
No The value of the localRepository system variable. The local Maven repository. You cannot configure this paramter using the plugin configuration. The system property is always used.
packageFile java.io.File No The primary artifact that is defined for the Maven project. The name of the package file to install.
packaging String No zip The type of packaging of the artifact to install
pomRemoteRepositories java.util.List Yes The value of the remoteAtifactRepositories property that is defined for the Maven project. This value cannot be configured using the plugin configuration. The value must be specified in the project. 
project org.apache.maven.
project.MavenProject
Yes The project for which the plugin is configured. The Maven project. The project is implicit because the project contains the plugin configuration.
repositoryId (POM)
repoID (command line)
String No temp The ID of the repository from which the artifact is retrieved. In a POM, use repositoryID. In a command line, use repoID.
repositoryUrl (POM)
repoURL (command line)
String No The URL of the repository from which the artifact is retrieved.  In a POM, use repositoryURL. In a command line, use repoURL.
version String No The version of the artifact to install.

Example

The following example creates a package that contains the workflow-mbean OSGi bundle (see the example for the build goal) and then installs the package. Because the install goal is bound to the package install phase, the following command executes the install goal:

mvn install
        
<project xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
    http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.adobe.example.myapp</groupId>
  <artifactId>workflow-mbean</artifactId>
  <version>0.0.3-SNAPSHOT</version>

  <build>
    <plugins>
      <plugin>
        <groupId>com.day.jcr.vault</groupId>
        <artifactId>content-package-maven-plugin</artifactId>
        <version>0.0.20</version>
        <configuration>
          <builtContentDirectory>jcr_root</builtContentDirectory>
          <targetURL>http://10.36.79.223:4502/crx/packmgr/service.jsp</targetURL>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>package</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
        

ls

Lists the packages that are deployed to Package Manager.

Parameters

All parameters of the ls goal are described in the Common Parameters section.

Example

The following example lists the packages that are installed on the CQ server with the IP address 10.36.79.223. The goal is executed using the followng command:

mvn content-package:ls
        

The following POM file is located in the current directory of the command line tool. The POM specifies the URL of the package service.

<project xmlns="http://maven.apache.org/POM/4.0.0" 
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
		xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.adobe.example</groupId>
  <artifactId>example-package</artifactId>
  <version>0.0.1-SNAPSHOT</version>
    <build>
        <plugins>
	    <plugin>
		<groupId>com.day.jcr.vault</groupId>
		<artifactId>content-package-maven-plugin</artifactId>
		<version>0.0.20</version>
		<configuration>
		    <targetURL>http://10.36.79.223:4502/crx/packmgr/service.jsp</targetURL>
		</configuration>
	     </plugin>
	  </plugins>
     </build>
</project>
        

rm

Removes a package from Package Manager.

Parameters

All parameters of the rm goal are described in the Common Parameters section.

Example

The following example removes the workfow-mbean package that is installed on the CQ server with the IP address 10.36.79.223. The goal is executed using the followng command:

mvn content-package:rm
        

The following POM file is located in the current directory of the command line tool. The POM specifies the URL of the package service and the name of the package.

<project xmlns="http://maven.apache.org/POM/4.0.0" 
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
		xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.adobe.example</groupId>
  <artifactId>example-package</artifactId>
  <version>0.0.1-SNAPSHOT</version>
    <build>
        <plugins>
	    <plugin>
		<groupId>com.day.jcr.vault</groupId>
		<artifactId>content-package-maven-plugin</artifactId>
		<version>0.0.20</version>
		<configuration>
                    <name>workflow-mbean</name>
		    <targetURL>http://10.36.79.223:4502/crx/packmgr/service.jsp</targetURL>
		</configuration>
	     </plugin>
	  </plugins>
     </build>
</project>
        

uninstall

Uninstalls a package. The package remains on the server in the uninstalled state.

Parameters

All parameters of the uninstall goal are described in the Common Parameters section.

Example

The following example uninstalls the workflow-mbean package that is installed on the CQ server with the IP address 10.36.79.223. The goal is executed using the followng command:

mvn content-package:uninstall
        

The following POM file is located in the current directory of the command line tool. The POM specifies the package name and the URL of the package service.

<project xmlns="http://maven.apache.org/POM/4.0.0" 
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
		xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.adobe.example</groupId>
  <artifactId>workflow-mbean</artifactId>
  <version>0.0.3-SNAPSHOT</version>
    <build>
        <plugins>
	    <plugin>
		<groupId>com.day.jcr.vault</groupId>
		<artifactId>content-package-maven-plugin</artifactId>
		<version>0.0.20</version>
		<configuration>
			<name>workflow-mbean</name>
			<failOnError>true</failOnError>
			<targetURL>http://10.36.79.223:4502/crx/packmgr/service.jsp</targetURL>
		</configuration>
	    </plugin>
	</plugins>
    </build>
</project>
        

package

Creates a content package. The default configuration of the package goal includes the contents of the directory where compiled files are saved. The execution of the package goal requires that the compile build phase has completed. The package goal is bound to the package phase of the Maven build lifecycle.

Parameters

In addition to the following parameters, see the description of the name parameter in the Common Parameters section.

Name Type Required Default Value Description
archive org.apache.maven.
archiver.
MavenArchiveConfiguration
No The archive configuration to use. See the documentation for Maven Archiver.
builtContentDirectory java.io.File Yes The value of the output directory of the Maven build. The directory that contains the content to include in package.
dependencies java.util.List No
embeddedTarget java.lang.String No
embeddeds java.util.List No
failOnMissingEmbed boolean Yes false A value of true causes the build to fail when an embedded artifact is not found in the project dependencies. A value offalse causes the build to ignore the error.
filterSource java.io.File No A file that specifies the source of the workspace filter. The filters specified in the configuration and injected via emebeds or subpackages are merged with the file content.
filters com.day.jcr.
vault.maven.pack.impl.
DefaultWorkspaceFilter
No Contains filter elements that define the package content. When executed, the filters are included in the filter.xml file. See the Using Filters section below.
finalName java.lang.String Yes The finalName defined in the Maven project (build phase). The name of the generated package ZIP file, without the .zip file extension.
group java.lang.String Yes The groupID defined in the Maven project. The groupId of the generated content package. This value is part of the target installation path for the content package.
outputDirectory java.io.File Yes The build directory defined in the Maven project. The local directory where the content package is saved.
prefix java.lang.String No
project org.apache.maven.
project.MavenProject
Yes The Maven project.
properties java.util.Map No Additional properties that you can set in the properties.xml file. These properties cannot overwrite the following predefined properties:
  • group: Use group parameter to set
  • name: Use name parameter to set
  • version: Use version parameter to set
  • description: Set from the project description
  • groupId: groupId of the Maven project descriptor
  • artifactId: artifactId of the Maven project descriptor
  • dependencies: Use dependencies parameter to set
  • createdBy: The value of the user.name system property
  • created: The current system time
  • requiresRoot: Use requiresRoot parameter to set
  • packagePath: Automatically generated from the group and package name
requiresRoot boolean Yes false Defines whether the package requires root. This will become the <code>requiresRoot</code> property of the properties.xml file.
subPackages java.util.List No
version java.lang.String Yes The version defined in the Maven project The version of the content package.
workDirectory java.io.File Yes The directory defined in the Maven project (build phase). The directory that contains the content to include in the package.

Using filters

Use the filters element to define the package content. The filters are added to the workspaceFilter element in the META-INF/vault/filter.xml file of the package.

The following filter example shows the XML structure to use:

<filter>
   <root>/apps/myapp</root>
   <mode>merge</mode> 
       <includes>
              <include>/apps/myapp/install/</include>
              <include>/apps/myapp/components</include>
       </includes>
       <excludes>
              <exclude>/apps/myapp/config/*</exclude>
       </excludes>
</filter>
        

Import mode

The mode element defines how content is the repository is affected when the package is imported. The following values can be used:

  • Merge: Content in the package that is not already in the repository is added. Content that is in both the package and the repository is unchanged. No content is removed from the repository. 
  • Replace: Content in the package that is not in the repository is added to the repository. Content in the repository is replaced with matching content in the package. Content is removed from the repository when it does not exist in the package.
  • Update: Content in the package that is not in the repository is added to the repository. Content in the repository is replaced with matching content in the package. No content is removed from the repository.  

When the filter contains no mode element, the default value of replace is used. 

Example

The following example creates a package that contains the workflow-mbean OSGi bundle. The POM file identifies the jcr_root directory as the value of the builtContentDirectory property. The jcr_root directory contains the bundle JAR file in the directory structure that mirrors the repository:

jcr_root/apps/myapp/install/workflow-mbean-0.03-SNAPSHOT.jar

Because the goal is bound to the package build phase, the following command executes the package goal:

mvn package
        
<project xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
    http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.adobe.example.myapp</groupId>
  <artifactId>workflow-mbean</artifactId>
  <version>0.0.3-SNAPSHOT</version>

  <build>
    <plugins>
      <plugin>
        <groupId>com.day.jcr.vault</groupId>
        <artifactId>content-package-maven-plugin</artifactId>
        <version>0.0.20</version>
        <configuration>
          <builtContentDirectory>jcr_root</builtContentDirectory>
          <targetURL>http://10.36.79.223:4502/crx/packmgr/service.jsp</targetURL>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>package</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
        

Instead of expressing the package goal in the plugin executions section, you can use content-package as the value of the project packaging element:

<project xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
    http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.adobe.example.myapp</groupId>
  <artifactId>workflow-mbean</artifactId>
  <version>0.0.3-SNAPSHOT</version>
  <packaging>content-package</packaging>
  <build>
    <plugins>
      <plugin>
        <groupId>com.day.jcr.vault</groupId>
        <artifactId>content-package-maven-plugin</artifactId>
        <version>0.0.20</version>
        <configuration>
          <builtContentDirectory>jcr_root</builtContentDirectory>
          <targetURL>http://10.36.79.223:4502/crx/packmgr/service.jsp</targetURL>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
        

help

Parameters

Name Type Required Default Value Description
detail boolean No false Determines whether to display all settable properties for each goal. A value of true displays all settable properties.
goal String No The name of the goal for which to show help. If no value is specified, help for all goals is displayed.
indentSize int No 2 The number of spaces to use for the indentation of each level. If you specify a value, the value should be positive.
lineLength int No 80 The maximum length of a display line. If you specify a value, the value should be positive.

Obtaining the Content Package Maven Plugin

The plugin is available from the public Adobe repository. To download the plugin, add the following Maven profile to your Maven settings file and activate it. When you use a Maven command, the plugin is downloaded to your local repository if needed.

Note: The Adobe Public Releases repository is not browsable, so that navigating to the repository URL using your web browser results in a Not Found error. However, Maven is able to access the repository directories.

 

<profile>
    <id>adobe-public</id>
    <activation>
         <activeByDefault>false</activeByDefault>
    </activation>
    <properties>
         <releaseRepository-Id>adobe-public-releases</releaseRepository-Id>
         <releaseRepository-Name>Adobe Public Releases</releaseRepository-Name>
         <releaseRepository-URL>http://repo.adobe.com/nexus/content/groups/public</releaseRepository-URL>
    </properties>
    <repositories>
         <repository>
             <id>adobe-public-releases</id>
             <name>Adobe Basel Public Repository</name>
             <url>http://repo.adobe.com/nexus/content/groups/public</url>
             <releases>
                 <enabled>true</enabled>
                 <updatePolicy>never</updatePolicy>
             </releases>
             <snapshots>
                 <enabled>false</enabled>
             </snapshots>
         </repository>
     </repositories>
     <pluginRepositories>
         <pluginRepository>
             <id>adobe-public-releases</id>
             <name>Adobe Basel Public Repository</name>
             <url>http://repo.adobe.com/nexus/content/groups/public</url>
             <releases>
                 <enabled>true</enabled>
                 <updatePolicy>never</updatePolicy>
             </releases>
             <snapshots>
                 <enabled>false</enabled>
             </snapshots>
         </pluginRepository>
     </pluginRepositories>
</profile>
        

Embedding OSGi Bundles in a Content Package

Use the Content Package Maven Plugin to embed OSGi bundles into the content package. To embed the bundle, implement the following configurations:

  • The bundle must be declared as a dependency of the Maven project.
  • The plugin configuration references the bundle using the desired path of the bundle in the package.

The following example POM creates a package that contains the Apache Sling JCR UserManager bundle. In the package, the bundle JAR is located in the jcr_root/apps/myapp/install folder:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
             http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
  	<groupId>com.adobe.example.myapp</groupId>
	<artifactId>embedded-example</artifactId>
	<packaging>content-package</packaging>
	<version>1.0.0-SNAPSHOT</version>

   <build>
	<plugins>
	    <plugin>
	       <groupId>com.day.jcr.vault</groupId>
		    <artifactId>content-package-maven-plugin</artifactId>
		    <version>0.0.20</version>
		    <extensions>true</extensions>
		    <configuration>
			<filters>
			    <filter>
				<root>/apps/myapp</root>
			    </filter>
			 </filters>
			 <embeddeds>
			    <embedded>
				<groupId>org.apache.sling</groupId>
				<artifactId>org.apache.sling.jcr.jackrabbit.usermanager</artifactId>
				<target>/apps/myproject/install</target>
			     </embedded>
			 </embeddeds>
		     </configuration>
		</plugin>	
	   </plugins>
    </build>
    <dependencies>
	<dependency>
	     <groupId>org.apache.sling</groupId>
	     <artifactId>org.apache.sling.jcr.jackrabbit.usermanager</artifactId>
	     <version>2.2.0</version>
	</dependency>
    </dependencies>	
</project>

        

Including a Thumbnail Image or Properties File in the Package

Replace the default package configuration files to customize the package properties. For example, include a thumbnail image to distinguish the package in Package Manager and Package Share.

In the package, FileVault-specific files are located in the /META-INF/vault folder. The source files can be located anywhere in your file system. In the POM file, define build resources to copy the source files to the target/vault-work/META-INF for inclusion in the package.

The following POM code adds the files in the META-INF folder of the project source to the package:

<build>
    <resources>
        <!-- vault META-INF resources (thumbnail etc.) -->
        <resource>
            <directory>${basedir}/src/main/content/META-INF</directory>
            <targetPath>../vault-work/META-INF</targetPath>
        </resource>
    </resources>
</build>
        

The following POM code adds only a thumbnail image to the package. The thumbnail image must be named thumbnail.png, and must be located in the META-INF/vault/definition folder of the package. In this example, the source file is located in the /src/main/content/META-INF/vault/definition folder of the project:

<build>
    <resources>
        <!-- thumbnail only -->
        <resource>
            <directory>${basedir}/src/main/content/META-INF/vault/definition</directory>
            <targetPath>../vault-work/META-INF/vault/definition</targetPath>
        </resource>
    </resources>
</build>
        

Using Archetypes To Generate CQ Projects

Several Maven archetypes are available for generating CQ projects. Use the archetype that corresponds with your development goals:

Note

The Apache Sling project also offers archetypes useful in CQ development. These are documented at http://sling.apache.org/site/maven-archetypes.html.

Each archetype generates the following items:

  • The project folder structure.
  • POM files.
  • FileVault configuration files. 

Archetype artifacts are available from the Adobe public Maven repository. To download and execute an archetype, identify the archetype and the Adobe repository using the parameters of the Maven archetype:generate command:

mvn archetype:generate -DarchetypeGroupId=com.day.jcr.vault \
-DarchetypeArtifactId={id_of_archetype} -DarchetypeVersion=1.0.2 \
-DarchetypeRepository=adobe-public-releases
        

The Maven archetype plugin uses interactive mode in the shell or command prompt to collect information about your project. The information that you provide is used to configure various project properties, such as folder names and artifact ID's.

POM files

The generated POM files include commands for compiling code, creating bundles, and deploying them to CQ in packages. The groupID, artifactId, version, and name properties of the Maven project are automatically populated using the values that you provide to the Maven archetype:generate interactive prompt.

You may want to change the the following default values in the generated pom.xml file:

  • The CQ server name or IP address: The default value is localhost. The crx.host element below project/properties contains this value.
  • The port number for the CQ server: The default value is 4502. The crx.port element below project/properties contains this value.
  • The version of Content Package Maven Plugin: Use the latest version as the content of the version element for the plugin with artifactId of content-package-maven-plugin.  The default value is 0.0.20.

Using the archetypes

  1. In a shell window or command prompt, enter the Maven archetype:generate command. When prompted, provide values for the remaining parameters.

    For information about each parameter, refer to the section for the archetype that you are using.

  2. Use a text editor to open the pom.xml file and edit default values according to your requriements.
  3. Populate the generated folders with resources.
  4. Enter the mvn clean install command. 

simple-content-package-archetype

Creates a maven project that is suitable for installing resources for a simple CQ application. The folder structure is that used below the /apps folder of the CQ repository. The POM defines commands for packaging the resources that you place in the folders and installing the packages on the CQ server.

Archetype artifact properties:

  • Group ID: com.day.jcr.vault
  • Artifact ID: simple-content-package-archetype
  • Version: 1.0.2
  • Repository: adobe-public-releases

Maven command:

mvn archetype:generate -DarchetypeGroupId=com.day.jcr.vault \
-DarchetypeArtifactId=simple-content-package-archetype \
-DarchetypeVersion=1.0.2 \
-DarchetypeRepository=adobe-public-releases
        

Archetype parameters:

  • groupId: The groupId of the content package that Maven generates. The value is autoatically used in the POM file. 
  • artifactId: The name of the content package. The value is also used as the name of the project folder.
  • version: The version of the content package.
  • package: This value is not used for simple-content-package-archetype.
  • appsFolderName: The name of the folder below /apps. 
  • artifactName: The description of the content package.  
  • packageGroup: The name of the content package group. This value configures the group parameter for the Package goal of the Content Package Maven Plugin.

Folder structure:

${artifactId}
   |- pom.xml
   |- README.txt
   |- src
      |- main
         |- content
             |- jcr_root
                 |- apps
                     |- ${appsFolderName}
                            |- components 
                               |- .content.xml
                            |- config
                            |- install
             |- META-INF
                 |- vault
                     |- config.xml
                     |- filter.xml
                     |- nodetypes.cnd
                     |- properties.xml
                     |- definition
                        |- .content.xml
        

simple-content-package-with-embedded-archetype

Performs the same tasks as the simple-content-package-archetype, and also downloads and includes an artifact from a public Maven repository. 

Archetype bundle properties:

  • Group ID: com.day.jcr.vault
  • Artifact ID: simple-content-package-with-embedded-archetype
  • Version: 1.0.2
  • Repository: adobe-public-releases

Maven command:

mvn archetype:generate -DarchetypeGroupId=com.day.jcr.vault \
-DarchetypeArtifactId=simple-content-package-with-embedded-archetype \
-DarchetypeVersion=1.0.2 \
-DarchetypeRepository=adobe-public-releases
        

Archetype parameters:

  • groupId: The groupId of the content package that Maven generates. The value is autoatically used in the POM file. 
  • artifactId: The name of the content package. The value is also used as the name of the project folder.
  • version: The version of the content package.
  • package: This parameter is not used.
  • appsFolderName: The name of the folder below /apps. 
  • artifactName: The description of the content package.  
  • embeddedArtifactId: The ID of the artifact to embed in the content package.
  • embeddedGroupId: The group ID of the artifact to embed.
  • embeddedVersion: The version of the artifact to embed.
  • packageGroup: The name of the content package group. This value configures the group parameter for the Package goal of the Content Package Maven Plugin.

Folder structure:

${artifactId}
   |- pom.xml
   |- README.txt
   |- src
      |- main
         |- content
             |- jcr_root
                 |- apps
                     |- ${appsFolderName}
                            |- components 
                            |- config
                            |- install
             |- META-INF
                 |- vault
                     |- config.xml
                     |- filter.xml
                     |- nodetypes.cnd
                     |- properties.xml
                     |- definition
        

multimodule-content-package-archetype

Creates a maven project that includes the folder structure for developing a CQ application and installing resources to the server.

The bundle folder contains the folder structure that stores the Java and JUnit source files that you develop. The pom.xml file in this folder creates the OSGi bundle. The following values in the POM identify the artifact and the bundle:

  • artifactID: ${artifactID}-bundle
  • Bundle-SymbolicName: ${groupId}.${artifactId}-bundle.

${artifactID} and  ${groupId} are the values that you provide for these parameters when executing the archetypes.

The content folder contains the resources that are installed to the CQ server. The value of artifactID is  ${artifactID}multimodule-bundle

The parent folder contains the parent POM that manages Maven plugins and dependencies. 

Archetype bundle properties:

  • Group ID: com.day.jcr.vault
  • Artifact ID: multimodule-content-package-archetype
  • Version: 1.0.2
  • Repository: adobe-public-releases

Maven command:

mvn archetype:generate -DarchetypeGroupId=com.day.jcr.vault \
-DarchetypeArtifactId=multimodule-content-package-archetype \
-DarchetypeVersion=1.0.2 \
-DarchetypeRepository=adobe-public-releases
        

Archetype parameters:

  • groupId: The groupId of the content package that Maven generates. The value is autoatically used in the POM file. 
  • artifactId: The name of the content package. The value is also used as the name of the project folder.
  • version: The version of the content package.
  • package: This value is not used for multimodule-content-package-archetype.
  • appsFolderName: The name of the folder below /apps. 
  • artifactName: The description of the content package.  
  • packageGroup: The name of the content package group. This value configures the group parameter for the Package goal of the Content Package Maven Plugin.

Folder structure:

${artifactId}
   |- pom.xml
   |- bundle
      |- pom.xml
      |- src
         |- main
            |- java
               |- ${groupId}
                  |- SimpleDSComponent.java
         |- test
            |- java
               |- ${groupId}
                  |- SimpleUnitTest.java
   |- content
      |- pom.xml
      |- src
         |- main
            |- content
               |- jcr_root
                  |- apps
                     |- ${appsFolderName} 
                            |- config
                            |- install
                  |- META-INF
                      |- vault
                         |- config.xml
                         |- filter.xml
                         |- nodetypes.cnd
                         |- properties.xml
                         |- definition
                            |- .content.xml