Here are the steps to create an AEM project using Maven Archetype:
- Install Maven: If you do not already have Maven installed on your system, you will need to download and install it.
- Open Command Prompt or Terminal: Open a Command Prompt window or Terminal on your system.
- Create a new directory: Create a new directory for your AEM project using the following command:
mkdir my-aem-project
- Navigate to the new directory: Navigate to the new directory using the following command:
cd my-aem-project
- Run the Maven Archetype command: Run the following Maven Archetype command to create a new AEM project:
mvn archetype:generate \ -DarchetypeGroupId=com.adobe.granite.archetypes \ -DarchetypeArtifactId=aem-project-archetype \ -DarchetypeVersion=27 \ -DgroupId=com.mycompany \ -DartifactId=my-aem-project \ -Dversion=1.0-SNAPSHOT \ -Dpackage=com.mycompany.myaemproject \ -DappsFolderName=my-aem-project \ -DartifactName="My AEM Project"
This command will create a new AEM project using the Maven Archetype, with the following parameters:
-DarchetypeGroupId
: The group ID of the Maven Archetype (com.adobe.granite.archetypes).-DarchetypeArtifactId
: The artifact ID of the Maven Archetype (aem-project-archetype).-DarchetypeVersion
: The version of the Maven Archetype to use (27).-DgroupId
: The group ID for your project.-DartifactId
: The artifact ID for your project.-Dversion
: The version number for your project.-Dpackage
: The package name for your project.-DappsFolderName
: The name of the apps folder in your project.-DartifactName
: The name of your project.
- Build the project: After the project is created, navigate to the root directory of the project and build it using the following command:
- Deploy the AEM package: Deploy the AEM package to your AEM instance using your preferred deployment method (such as using the AEM Package Manager).
mvn clean install
This will build the project and create an AEM package that can be deployed to an AEM instance.
Congratulations! You have successfully created an AEM project using Maven Archetype.