Monday, 18 April 2016

How to Build AEM project in Eclipse using AEM Archetype

How to Build AEM project in Eclipse using AEM Archetype

How to build AEM project in Eclipse using AEM Archetype


To build a AEM structured project in eclipse please follow the following steps.

Step 1: Configure the AEM Archetype in Eclipse.

Before we begin our development, we need to first configure the AEM Archetype so that we can use it for building AEM related Maven Projects in Eclipse.

1. Open Eclipse.

2. Go to Window --> Preferences

3. From the left side window, expand the Maven option.

4. Click on Archetypes.
How to Build AEM project in Eclipse using AEM Archetype

5. Click on Add Remote Catalog.

6. In the Catalog File text box enter the URL : https://repo.adobe.com/nexus/content/groups/public/archetype-catalog.xml

7. In the Description text box enter "AEM".

How to Build AEM project in Eclipse using AEM Archetype

8. Click OK. Click Apply. Click OK.
How to Build AEM project in Eclipse using AEM Archetype



Step 2: Creating a new AEM Maven Project

Now that we have configured the AEM Archetype, we need to proceed creating a AEM project in Eclipse.
Lets proceed:


1. In Eclipse goto File--> New --> Other

2. Browse and Select Maven --> Maven Project --> Next.

How to Build AEM project in Eclipse using AEM Archetype


3. Click Next again.


How to Build AEM project in Eclipse using AEM Archetype




4. Choose the "AEM" Archetype from the Catalog dropdown.

5. Choose the "aem-project-archetype" from the list of options.


How to Build AEM project in Eclipse using AEM Archetype

6. Click Next. It will download some required artifacts.


How to Build AEM project in Eclipse using AEM Archetype



7. Now enter the required details as shown below.


How to Build AEM project in Eclipse using AEM Archetype


8. Now click Finish.
9. You will now have a project Structure like this.


How to Build AEM project in Eclipse using AEM Archetype

10. Please DO NOT worry if you see red marked errors in the project.After a build it will disappear.



Step 3: Building the AEM Maven Project

Now after we have created the basic project structure we nee to build our project.

1. Right click on the parent project "newProject".

2. Go to Run As. Click the second option 2 Maven Build.

How to Build AEM project in Eclipse using AEM Archetype


3. Type in clean install in the Goals text box.
How to Build AEM project in Eclipse using AEM Archetype


NOTE:If you are using any External API Jars then please add the depenencies in your pom.xml before building. Else the build will fail.


4. It will start the build and download many resources.

How to Build AEM project in Eclipse using AEM Archetype
5. Downloading may take upto 30 Minutes. So please be patient.

6. After the Build we will see how we can use our project to build AEM Applications.


THE NEXT PART...

AEM Project Structure in Eclipse




1 comment:

  1. Wow Rammez...did a great job..Eagerly waiting for your next part.

    ReplyDelete

Coder Magnet
CoderMagnet is full of resources from our daily development activities. It has solutions for common problematic scenarios in technologies like Java 8, AEM, JCR and also occasionally gives you tips on Blogger as well.