Development in AEM

20/06/2020 / BY / IN Component Development / 8 Comments

Development in AEM

Welcome to the part 2 of Adobe Experience Manager learning. This is part one – Development in AEM. There I’m going to show the essentials of AEM development.

Let’s highlight the objectives, after the lesson you will

  • Understand developers’ activities in typical AEM implementation.
  • Get acquainted with development tools to use, prerequisites for development environment.
  • In the end of this section you will able to create new project created from maven archetype with sample components and services.

You also going to learn how to create a new AEM project using Maven archetype.

To start development for AEM you should have Java 8/Java 11 installed on your local machine, apart from that Maven required to build the project and make use of plugins. IDE installation is optional though it will help you to simplify your work. You also must have certain knowledge in such areas, web development using Java stack, client side technologies, and Web services like REST.

Development Tools

In the above picture you can see the main development tool for AEM, most of them are standard tools with few configurations.

  1. IDE section has CRXDE Lite or Brackets, which are not come for Java projects.
  2. The stack also involves standard set of
  3. Version Controls System Features,
  4. Continuous Integration Tools,
  5. Maven paired with custom build plugins,
  6. Features for effective Dependency Management resolution and
  7. Technologies for writing tests.

Today we are going to have a closer look at

  • Development Tools,
  • Build Tools and
  • Dependency Management.

Responsibilities of AEM Developer

An AEM Developer performs task related to all levels of architecture, at the initial stage of the project most activities consists of development, business logic and components, including after in instance. As a project goes on other activities adapts such as support for mobile application in sites, setting application at web server, Multi-Language (MSM) web site support, development of custom Workflows and etc.

So the first question that beginners encounter is “How Do You Create a New Project?”

Maven Archetype

to create a project you can use a Maven archetype, different versions of AEM have the most readable version of archetype for instance AEM 6.5 require version 22 or 23, where AEM 6.2 use version 10.

Link: https://github.com/adobe/aem-project-archetype/releases

Another option available is ACS Common’s Lazybones on project templates, the key benefit of using such that, they use a very best practices of AEM projects and provide flexibility through configuration options.

for more details visit:

  1. https://helpx.adobe.com/experience-manager/using/aem_lazybones.html
  2. https://github.com/Adobe-Consulting-Services/lazybones-aem-templates

We are going to create AEM project from Maven archetype, now creating an AEM project from archetype is pretty straight forward, all you have to do is to get to Adobe Marketing Cloud archetype GitHub page, and look for the command. Please watch the video for more details.

Link: https://github.com/adobe/aem-project-archetype/releases

Having just created a project you will be able to see the following structure

There are 6 areas to the project to make use of

  1. Parent pom: Its purpose is deploying Maven modules and manages dependency version.
  2. Core: Java bundles containing all core functionality like OSGi services, listeners or schedulers as well as component related Java code such as servlets or request filters.
  3. Apps: This part contains the apps part of the repository which are clientlibs, components and templates, runmode specific configurations as well as Hobbes-tests.
  4. Content: contains structural content and configurations.
  5. Tests: It consists of java bundle containing JUnit test that are executed on server-side – this bundle is not to be deployed on production.
  6. Launcher: It glue code that deploys the test bundle to the server and triggers the remote JUnit execution.
  7. Frontend: an optional dedicated front-end build mechanism based on Webpack.

“How Do You Deploy Projects to an AEM instance?”

So how does a project will deploy to instance – is begin deployed using a set of Maven plugins, because the core Maven is small and simple. Most of the functionality is provided through plugins. These do things like compiling sources, packaging a WAR file, or running Junit tests.

The Maven Plugins are retrieved from the Maven Repository – either the Central Maven Repository or another specified repository.

Maven Plugins

To deal with the project AEM uses the following plugins:

  1. Content Package Maven Plugin:
    That allows you to create a new packages from files in the file system.
    Install and uninstall packages on the CRX or AEM server.
    Build packages that are installed on the server.
    Remove a package from the server.
  2. Apache Felix Bundle Plugin:
    That is necessary to make bundles of packages that are then detected by AEM and to provide the possibility to generate a manifest file for a bundle from Maven properties.
  3. Maven Sling Plugin: Allows you to install a bundle into AEM using specific goal.
  4. Maven SCR Plugin: is used to read OSGi annotations from your services and components and to generate valid metadata for this.

Note: In order to create OSGi components using Declarative Services you should use the official annotations from the OSGi R6 specification, because development of SCR plugin is in maintenance mode and will be removed soon.

Pages: 1 2 3 4

8 comments on Development in AEM
  1. Malaya Ranjan Dube Says

    21/06/2020

    Santosh it’s really osm . I have gone through this document really it would be helpful for all aem developer . Thanks 😊

    Reply

  2. BSR Says

    21/06/2020

    Great articles that are indepth. Pls keep going. Thankyou.

    Reply

  3. Adarsh Says

    21/06/2020

    Nice article.

    Reply

  4. Prabhu K Says

    21/06/2020

    Great Article for all AEM developers santosh, keep going on.

    Thanks

    Reply

  5. Sathish Says

    21/06/2020

    Very well written. Keep up the great work. 👌

    Reply

  6. Swati Dubey Says

    21/06/2020

    Great Article Santosh ! Really helpful in understanding the Aem development methodology

    Reply

  7. Shiv Prakash Says

    22/06/2020

    Very well explained and helpful to understand the AEM basic. Great Blog Santosh !!!

    Reply

  8. Nandini Says

    22/06/2020

    Very Informative article Santosh! keep up the good work!!

    Reply

Leave a Reply