top of page
Writer's pictureHeena

How to generate an AEM Project

Updated: May 2

Today we will generate an AEM Project using a Maven archetype with the help of command line.

Prerequisites:

  1. JDK should be installed

  2. Maven should be installed


  1. What is Maven Project? Apache Maven is a software project management and comprehension tool. All Adobe Experience Manager Projects leverage Maven Project to generate, build, and deploy code.

  2. What is Maven Archetype? Archetype is a Maven project templating toolkit. AEM requires project code to be in particular structure. To generate this pre-created structure we use "aem-project-archetype" as an Archetype Id.


Paste the following into the command line to generate the project in batch mode and hit ENTER:

mvn -B archetype:generate \
    -D archetypeGroupId=com.adobe.aem \
    -D archetypeArtifactId=aem-project-archetype \
    -D archetypeVersion=35 \
    -D appTitle="WKND Sites Project" \
    -D appId="wknd" \
    -D groupId="com.adobe.aem.guides" \
    -D artifactId="aem-guides-wknd" \
    -D package="com.adobe.aem.guides.wknd" \
    -D version="0.0.1-SNAPSHOT" \
    -D aemVersion="cloud"


This will create following project structure:

    |--- aem-guides-wknd/
        |--- all/
        |--- core/
        |--- ui.apps/
        |--- ui.apps.structure/
        |--- ui.config/
        |--- ui.content/
        |--- ui.frontend/
        |--- ui.tests /
        |--- it.tests/
        |--- dispatcher/
        |--- archetype.properties
        |--- pom.xml
        |--- README.md
        |--- .gitignore

To Deploy the project to running AEM instance, execute following command at project repository folder(in this case at aem-guides-wknd)


mvn clean install -PautoInstallSinglePackage

The Maven profile "autoInstallSinglePackage" compiles the project and deploys as a single package to the AEM instance. By default the port is set to 4502 with the credentials of admin:admin. You can update it in parent pom.xml


If you receive following message it means the build was successful and project was deployed to the AEM instance.


command prompt


That's all for today! If you've found this blog post informative or helpful, I’d greatly appreciate it if you could give it a like. It keeps me motivated 💛


Enjoying my ad-free blog? Support by buying me a coffee! I've kept this space ad-free, sponsoring it myself to maintain its purity. Your contribution would help keep the site afloat and ensure quality content. Thanks for being part of this ad-free community.

149 views

Related Posts

See All

Comments


bottom of page