Basic usage

Generate a new AEM project using interactive mode by executing:

mvn archetype:generate \
  -DarchetypeGroupId=io.wcm.maven.archetypes \
  -DarchetypeArtifactId=io.wcm.maven.archetypes.aem \
  -DarchetypeVersion=2.4.8

As minimal input parameters you have to enter a value for groupId and projectName - all other parameters can be derived from these or have sensible default parameters. But in most cases you want to specify more parameters, see next chapters for all available parameters and some examples.

Archetype parameters

Parameter Default Description
projectName Project name is used for building AEM apps path, content path, CONGA role names etc.
groupId Maven artifact groupId for all projects
artifactId *) Maven artifact “root” artifactId, is suffixed for the individual modules
version *) Maven artifact version - e.g. 1.0.0-SNAPSHOT
package *) Java class package name
packageGroupName *) Group name for AEM content package
aemAuthorPort 4502 Default port for local AEM author instance
aemPublishPort 4503 Default port for local AEM publish instance
optionJavaVersion 8 Java version (8 or 11)
optionAemVersion 6.5 AEM major version (6.3, 6.4 or 6.5)
optionAemServicePack n Use latest service pack for AEM version - you need to deploy artifacts following these conventions
optionSlingModelsLatest n Use latest Sling Models version
optionSlingInitialContentBundle y y: AEM application projects is set up with scripts and content parts as JSON files within the OSGi bundle with Sling-Initial Content, suitable for File System Resource Provider. Works with all AEM versions.
n: Projects are set up with FileVault package layout, suitable for AEM Developer Tools for Eclipse (Sling IDE). Only supported for AEM 6.3+.
optionEditableTemplates y Set up projects using editable templates. Only supported for AEM 6.3+.
optionMultiBundleLayout n Split up AEM application in multiple bundles for modularizing large AM applications. Requires optionSlingInitialContentBundle=‘y’.
optionContextAwareConfig y Setup project with Sling Context-Aware Configuration and wcm.io Context-Aware Configuration extensions.
optionFrontend n Setup frontend build project with webpack
optionNodeJsPlugin n Use wcm.io Node JS plugin for frontend build (recommended when Maven NodeJS Proxy is used). If not enabled the frontend-maven-plugin is used instead.
optionWcmioHandler n Setup project using wcm.io AEM libraries, especially the wcm.io Handler Infrastructure and wcm.io WCM Core Components. Requires optionContextAwareConfig=‘y’.
optionAcsCommons n Deploy ACS AEM Commons.

*) Sensible default

Usage examples

AEM project with wcm.io and Sling-Initial-Content project layout and Java 11
mvn archetype:generate -DinteractiveMode=false \
  -DarchetypeGroupId=io.wcm.maven.archetypes \
  -DarchetypeArtifactId=io.wcm.maven.archetypes.aem \
  -DarchetypeVersion=2.4.8 \
  -DprojectName=myproject1 \
  -DgroupId=mycompany.myprojectgroup \
  -DartifactId=mycompany.myprojectgroup.myproject1 \
  -Dversion=1.0.0-SNAPSHOT \
  -Dpackage=mycompany.myprojectgroup.myproject1 \
  -DpackageGroupName=mycompany \
  -DaemAuthorPort=4502 \
  -DaemPublishPort=4503 \
  -DoptionJavaVersion=11 \
  -DoptionAemVersion=6.5 \
  -DoptionAemServicePack=n \
  -DoptionSlingModelsLatest=y \
  -DoptionSlingInitialContentBundle=y \
  -DoptionEditableTemplates=y \
  -DoptionMultiBundleLayout=n \
  -DoptionContextAwareConfig=y \
  -DoptionWcmioHandler=y \
  -DoptionAcsCommons=n \
  -DoptionFrontend=y \
  -DoptionNodeJsPlugin=n
Minimal AEM project with FileVault package layout and Java 8
mvn archetype:generate -DinteractiveMode=false \
  -DarchetypeGroupId=io.wcm.maven.archetypes \
  -DarchetypeArtifactId=io.wcm.maven.archetypes.aem \
  -DarchetypeVersion=2.4.8 \
  -DprojectName=myproject2 \
  -DgroupId=mycompany.myprojectgroup \
  -DartifactId=mycompany.myprojectgroup.myproject2 \
  -Dversion=1.0.0-SNAPSHOT \
  -Dpackage=mycompany.myprojectgroup.myproject2 \
  -DpackageGroupName=mycompany \
  -DaemAuthorPort=4502 \
  -DaemPublishPort=4503 \
  -DoptionJavaVersion=8 \
  -DoptionAemVersion=6.5 \
  -DoptionAemServicePack=n \
  -DoptionSlingModelsLatest=n \
  -DoptionSlingInitialContentBundle=n \
  -DoptionEditableTemplates=y \
  -DoptionMultiBundleLayout=n \
  -DoptionContextAwareConfig=y \
  -DoptionWcmioHandler=n \
  -DoptionAcsCommons=y \
  -DoptionFrontend=n \
  -DoptionNodeJsPlugin=n

Requirements

  • Java 8 or Java 11
  • Apache Maven 3.3.9 or higher
  • AEM 6.3, 6.4 or 6.5 running on your local machine
  • Include the Adobe Public Maven Repository in your maven settings, see wcm.io Maven Repositories for details.
  • Optional: If you want to install latest service packs you have to upload them manually to your Maven Artifact Manager following these conventions for naming them.

Back to top

Version: 2.4.9-SNAPSHOT. Last Published: 2020-04-04.