To create an Experience Manager archetype project, perform these steps:
1. Open the command prompt and go to your working directory (for example, C:\AdobeCQ).
2. Run the following Maven command:
mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=13 -DarchetypeCatalog=https://repo.adobe.com/nexus/content/groups/public/
3. When prompted, specify the information as per your requirement. Refer the below for example:
- groupId – com.aem.explained
- artifactId – aem-explained
- version – 1.0-SNAPSHOT
- package – com.aem.explained.platform
- appsFolderName – aemexplained
- artifactName – AEM Explained
- componentGroupName – AEM Explained
- confFolderName – aemexplained
- contentFolderName – aemexplained
- cssId – aemexplained
- packageGroup – aemexplained
- siteName – AEM Explained
4. When prompted, specify Y.
5. Once done, you will see a message like:
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 01:42 min
[INFO] Finished at: 2019-12-16T19:08:48+05:30
[INFO] Final Memory: 16M/463M
[INFO] ————————————————————————
6. Change the working directory to aem-explained using cd aem-explained. you can see below modules.
- core – where Java files that are used in OSGi services and sling servlets are located
- launcher – where additional Java files are located
- tests – Java files for tests like JUNIT tests
- apps – content under /apps
- content – content under /content
7. Off these modules, we need core and apps for development. To ignore other modules, open aem-explained/pom.xml and comment following lines as shown below: (Line No: 28,29 & 30)
<!--module>ui.content</module--> <!--module>it.tests</module--> <!--module>it.launcher</module-->
8. Now open command prompt, change working directory to aem-explained and then enter the following command.
mvn clean install -PautoInstallPackage
Once done, you will see a message like this:
[INFO] ————————————————————————
[INFO] Reactor Summary for aem-explained 1.0-SNAPSHOT:
[INFO]
[INFO] aem-explained ……………………………….. SUCCESS [ 0.989 s]
[INFO] AEM Explained – Core …………………………. SUCCESS [ 20.518 s]
[INFO] AEM Explained – UI apps ………………………. SUCCESS [ 10.928 s]
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 39.602 s
[INFO] Finished at: 2019-12-16T19:29:49+05:30
[INFO] ————————————————————————
9. Now verify build and installation in aem instance. Open http://localhost:4502/crx/packmgr/index.jsp
10. You should see aem-explained packages installed as shown below:
11. Open crd/de and verify project folder under apps and conf. http://localhost:4502/crx/de/index.jsp#/apps/aemexplained
12. Go to AEM Sites ( http://localhost:4502/sites.html/content ) and open AEM Explained/English page ( http://localhost:4502/sites.html/content/aemexplained/en ). Select English page and click edit
13. You can see the aem-explained site English page. You have successfully created maven project and deployed it in AEM instance.