#1 Maven Multi-Module Project Creation

Presented by David G.

A quick run down of creating a new Adobe AEM project using Adobe's Multi-Module Maven Archetype.

Apache Maven Download

Apache Maven Download: http://maven.apache.org/download.cgi

Adobe AEM Multi-Module Maven Archetype

Create AEM Multi-Module Archetype

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

Maven Commands

  • Assumes multimodule-content-package-archetype version 1.0.2 or later *

  • Install to CQ Author (admin:admin@localhost:4502)
    • Install only OSGi Bundle
      • mvn install -PautoInstallBundle
    • Install CQ Package (including OSGi Bundle Jar)
      • <code>mvn install -PautoInstallPackage
  • Install to CQ Publish (admin:admin@localhost:4503)
    • Install only OSGi Bundle
      • mvn install -PautoInstallBundlePublish
    • Install CQ Package (including OSGi Bundle Jar)
      • mvn install -PautoInstallPackagePublish

settings.xml

After installing Maven, update your ~/.m2/settings.xml with Adobe’s Public Repositories.

More information can be found at: http://helpx.adobe.com/cq/kb/HowToUseCQ5AsMavenRepository.html

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>${user.home}/.m2/repository</localRepository>
  <interactiveMode>true</interactiveMode>
  <profiles>
    <profile>
      <id>adobe-public</id>
      <activation>
        <activeByDefault>true</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>
  </profiles>
  <activeProfiles>
    <activeProfile>adobe-public</activeProfile>
  </activeProfiles>
</settings>