Create AEM Project using Maven Archetype

Adobe Experience Manager (AEM) provides a powerful way to develop enterprise-level websites and applications. To kickstart an AEM project efficiently, we use Maven Archetypes, which provide a structured project template. In this guide, we’ll walk through the process of generating an AEM project using Maven.


 Prerequisites:

1️⃣ Java Development Kit (JDK 1.8 or JDK 11)

2️⃣ Apache Maven (3.6.3 or later)

3️⃣ AEM SDK (for local development)

4️⃣ Node.js & npm (for front-end development)

Step-by-Step Guide to Creating an AEM Project:

1️⃣ Run the Maven Command, Open your terminal or command prompt, and execute the following command:

mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=35 -D appTitle=”Tech Stack Pulse” -D appId=”TSP” -D groupId=”com.adobe.aem.tsp” -D artifactId=”tech-stack-pulse” -D package=”com.adobe.aem.tsp” -D version=”0.0.1-SNAPSHOT” -D aemVersion=”6.5.13

2️⃣ Understanding the Command:

Parameter Description
-B Runs in batch mode (non-interactive)
archetypeGroupId=com.adobe.aem Specifies the AEM archetype group
archetypeArtifactId=aem-project-archetype Defines the AEM project structure
archetypeVersion=35 Uses Archetype version 35 (latest version)
appTitle=”Tech Stack Pulse” Sets the project title
appId=”tsp” Defines the application ID
groupId=”com.adobe.aem.tsp” Sets the Java package namespace
artifactId=”tech-stack-pulse” Defines the final project folder name
package=”com.adobe.aem.tsp” Configures the Java package structure
version=”0.0.1-SNAPSHOT” Sets the initial project version
aemVersion=”6.5.13″ Configures the project for AEM, (  Cloud Service “cloud”)

 

  • You can use archetypeVersion(35) as per your requirements.
  • Set aemVersion=cloud for AEM as a Cloud Service.
  • Set aemVersion=6.5.0 for AEM as Adobe Managed Services or on-premise deployment.

 

3️⃣ To create an AEM project using the command prompt, open CMD, navigate to your desired directory and run the above project creation command.

4️⃣ Errors may occur while building a project, Resolving some errors.

Error 1:

 

 

 

 

Resolving the first error:

Step 1: Rename the dispatcher module to dispatcher.ams.

 

Step 2: Open the pom.xml file, remove the dispatcher module, and save the changes.

 

step 3: Navigate to the project folder and rebuild the project using the following command: mvn package

 

 

Leave a Comment