Create AEM Multi Module Project using Eclipse

The focus of this tutorial is to learn how to AEM Multi Module Project and build it using maven. This tutorial is intended for AEM beginners who are facing issue in setting up their eclipse work space.

I personally like this tutorial very much as it clear lot of basics and recommend it for advanced developers also to go through it once. If you want to learn how to create or setup a new project in AEM from scratch and how to sync data between eclipse and crxde .

After completing this tutorial. you will have a clear understanding of:-

Pre-requisites for creating a mvn archetype Project:-

Install AEM Plugin from MarketPlace

  • Open Eclipse
  • Go to Help available in top bar.
  • Select Eclipse Marketplace
  • Search for AEM.

install aem plugin in eclipse

  • Click install.
  • On next screen Click Confirm.
    confirm aem plugin in eclipse
  • Accept terms and condition and click Finish.
  • Press OK on Warning.
    cofirm warning aem eclipse plugin
  • Once installation is completed. Restart Eclipse.

Create AEM multi module project using aem plugin

  • Open Eclipse.
  • select File -> New project -> Select AEM Sample Multi-Module Project.
    create new aem multi-module project eclipse
  • Click Next to select Archetypeselect project location and archtype
  • Click Next to configure AEM Archetype project
    configure archtype properties for aem project
  • If you expand Advanced option.
    • You can see that Name maps to artifactName and appsFolderName
    • Package maps to location org/training folder in your .m2 directory. during maven build your code will be copied at this location.
    • Artifact Id maps to cssId. It is the unique id for your project.
  • Click Next for server configuration. Select don’t deploy on server as we are going to use maven command for deployment.
  • Click Finish.
  • Your project structure should look like below screenshot.aem mvn multi-module project structure

Note: – It will take around 5-10 minutes for setting up your project structure.
AEM maven multi-module project structure

Modify pom.xml to add profiles

  • Open pom.xml of aemcq5tutorials.ui.apps and aemcq5tutorials.ui.content.
  • Go to profiles section and add below code.


Similarly we can add or publish enviroment.

Note: – If you don’t have any profile with the name you are trying to build then you will get warning message during build “the requested profile could not be activated because it does not exist”.

Build AEM Multi Module project using Maven

  • On your local system go to aemcq5tutorials pom.xml location.
  • Open command prompt and run below command
mvn clean install -P aemcq5tutorials-author

build mvn multi module project

  • Once build is success

maven multi module build success

  • Go to localhost:4502/crx/de
  • You can see you project structure is mapped to crxde from eclipse.
    crxde project structure

Note:- If your project is in installed state in Felix console and getting import error “javax.inject;version” . Then add below line in your project core pom.xml

--><!-- Add below line -->

Click Here to Learn How to create project in aem using maven archetype command.

Also see how to sync content from crxde to eclipse using vlt plugin.

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.