Skip to main content

Day 03: Setting up AEM Development Environment


AEM Developer Series

Welcome to the third day of learning AEM development.
In previous posts, we discussed the AEM architecture and in this post, we are going to see how to set up an AEM development environment.

Prerequisites

To set up a development environment, we need the following - 
  1. Java should be installed (preferably JDK 1.8)
  2. Eclipse IDE (preferably Eclipse-Photon). You can also use other IDEs such as IntelliJ IDEA.
  3. Maven should be installed (preferably 3.5.3)
Below steps can be followed to set up a development environment

Installing AEM Plugin

  • Open Eclipse and go to the Help menu and then select Eclipse Marketplace...
Eclipse Marketplace
  • After opening Eclipse Marketplace, you will see a popup. In this popup, enter AEM in the Find bar. It will search through the web and will display the AEM plugin for eclipse. Click on Install.
Install the AEM plugin
  • Accept the License agreement and Finish
License Agreement and Finish
  • The eclipse will take some time to install the software and will show a popup. Click on Install Anyway
Security Warning
  • Once the software is installed, Restart the Eclipse to reflect changes.

Installing AEM Developer Tools

AEM developer tools provide us with many features such as integration of AEM server and eclipse, sync of content and bundles, debugging, modification of JCR properties and many more. 
To install AEM Developer tools, follow the below steps - 
Installation Link
  • In Eclipse, go to Help, then Install New Software...
Install New Software
  • Click Add..., then in the name field, put "AEM Developer Tools" and in the location field. paste the installation link.
  •  Click Next, Next and Finish. Restart the eclipse to so the new changes are reflected.

Create a New Project

  • Go to New, then New Project, then Other and select AEM Multimodule Project and click Next
AEM Multimodule project
  • Select Maven Archetype 14, click Next
Maven Archetype
  • Put the required fields as shown in the figure and click on Next
Project properties
  • Select Don't deploy on a server and click Finish
Finish
  • The project will be created will default template. This will have the following children projects - core, launcher, tests, apps and content.

Connecting with AEM Server

In this section, we will see how can we connect our AEM server to our eclipse code.
  • Go to AEM Perspective and in the Servers tab, click on create a new server
Add new server
  • Add resources to the server and click Finish
Add resources
  • Once the server is created, we can configure it by double-clicking on the same
Configuring Server
  • After configuration, right-click on the server and start it.
Starting the server
  • Once the server is started, you can import and export content from and to the AEM instance.
  • After doing these steps, our AEM server and Eclipse are connected and we can sync them accordingly.

Installing bundle in AEM using eclipse

We can also install our bundle in the AEM server via eclipse. Below are the required steps - 
  • Select all the maven projects and right-click. Then Run As and then Run Configurations...
Run Configurations
  • Select Maven Build from the options and double click to create a new configuration. Fill the required values and click Apply and Run
Run
  • Once the project is built successfully, you will see the following message in the console
[INFO] Reactor Summary:
[INFO] 
[INFO] demo 0.0.1-SNAPSHOT ................................ SUCCESS [  2.194 s]
[INFO] Demo Project - Core ................................ SUCCESS [ 17.958 s]
[INFO] Demo Project - UI apps ............................. SUCCESS [ 22.312 s]
[INFO] Demo Project - UI content .......................... SUCCESS [  4.428 s]
[INFO] Demo Project - Integration Tests Bundles ........... SUCCESS [  3.694 s]
[INFO] Demo Project - Integration Tests Launcher 0.0.1-SNAPSHOT SUCCESS [ 16.746 s]
[INFO] ---------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ---------------------------------------------------------------
[INFO] Total time: 01:13 min
[INFO] Finished at: 2018-10-09T10:26:47+05:30
[INFO] ---------------------------------------------------------------

  • You can go to ./system/console/bundles in AEM and see your bundle will be installed. Check if the bundle is in the Active state. If it is not, then we need to rectify it accordingly.

Conclusion

So finally, we have reached the end of this post. In this post, we set up the development environment for the AEM and also saw how can we connect AEM with our custom project.
Since now we have our development environment set up so we will be developing our custom code on top of it in our future posts. I hope you enjoyed this post.

I would love to hear your thoughts on this and would like to have suggestions from you to make it better. 

Feel free to befriend me on Facebook, Twitter or Linked In or say Hi by email.

Happy Learning 😊

Comments

  1. some people will get an error initially.Try creating with different project name.
    Informative blog.Good work.

    ReplyDelete
  2. Hi...

    Thanks for the informative blog. I am very new AEM. I am trying to replicate the steps. Tried with same project name and also different project name also. But still am not able to start the server. Can you please help me to resolve this.

    No repository found at http://localhost:4502/
    http://localhost:4502/server/default/jcr:root : org.apache.http.conn.HttpHostConnectException: Connect to localhost:4502 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
    http://localhost:4502/crx/server/crx.default/jcr:root : org.apache.http.conn.HttpHostConnectException: Connect to localhost:4502 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
    No repository found at http://localhost:4502/
    http://localhost:4502/server/default/jcr:root : org.apache.http.conn.HttpHostConnectException: Connect to localhost:4502 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
    http://localhost:4502/crx/server/crx.default/jcr:root : org.apache.http.conn.HttpHostConnectException: Connect to localhost:4502 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect

    ReplyDelete
    Replies
    1. The exception is indicating that your AEM instance is either no running or if it is running, it is not on port 4502. Please verify that.

      Delete

Post a Comment

Popular posts from this blog

Day 00: AEM Developer Series

Hello everyone! Welcome to this AEM development series. We can all see that the revolution of Digital Marketing today. Companies are dying to be a part of it and they have made this a war for the Digital Marketing tools.

Adobe was way ahead in this war and have gained a lot of market capture. They are leaders in the Digital Marketing platforms since the 2014-15. One of the flagship product in its Digital Marketing suite is Adobe Experience Manager (AEM).

Since AEM is in huge demand, the people who know how to develop on AEM are also in huge demand. But developing on AEM is not easy as it is made up of various open-source technologies such as Apache Felix (OSGi), Apache Sling, Apache Oak and Adobe's own technologies like Granite, HTL etc. Learning all these technologies in conjunction can sometimes become confusing and frustrating 😫.

When I first started learning AEM in 2016, I was dumbfounded to see there is so much going on under the hood. I then spent months to gather all the …

Day 01: Introduction to AEM

Day 04: Developing first OSGi bundle