April 1, 2020
Estimated Post Reading Time ~

Create AEM Project Structure using Lazybones

Lazybones is a command-line tool to create an AEM project structure. Adobe is recommending its customers to create the AEM project structure using Lazybones instead of traditional Maven archetype 10. As when we create an AEM project using the Maven archetype it is not easy to customize, it provides lots of sample content and packages like a test, launcher. This might not be required for your project, on the contrary, lazybones's bones are very interactive, flexible, and easy to customize according to your project need.

Adobe Consulting Services (ACS) provides an AEM multi-module template using which you can create AEM projects, which includes a lot of default config options and also provides an option to include the ACS commons package as a subpackage.

The aim of this tutorial is to learn what is lazybones and how we can use it to create an aem skeleton project structure, as Adobe Consulting Services (ACS) has updated the template version and provided the support for AEM 6.3 also I am going to create the project structure for AEM 6.3, for learning, I am using windows machine so we are going to install lazybones on windows, but you can install it on Linux and other operating systems also.

Lazybones Overview: Lazybones is a command-line tool and is built in two parts. First lazybones command-line tool and second project templates. This command-line tool allows you to create a new project structure for any framework or library for which the tool has a template. Currently, ACS has contributed one template for creating AEM multi-module project, which we are going to use in this tutorial. You can also contribute templates by sending pull requests to this GitHub project or publishing the packages to the relevant Bintray repository.

Install Lazybones
In order to install Lazybones for creating project skeleton in aem follow below steps:-

Go to link https://bintray.com/pledbrook/lazybones-templates/lazybones#files and download the latest lazybones.zip (0.8.3).


Extract the zip file and set the environment path variable to \lazybones-0.8.3\bin Open command prompt and type lazybones.
If lazybones is successfully installed then you will see list of available commands as shown below.
Note:- If you get error like lazybones is not a command, then check environment path is configured correctly or download the package again as it might be corrupted.

Create project structure using Lazybones
Command to create new project
lazybones create <template name> <template version> <target directory>

Note: Here template version is optional and if you leave it out, Lazybones will install the latest version of the template it can find.

Steps to create project using Lazybones:
Open command prompt.
Run below command lazybones create aem-multimodule-project 1.0 D:/CQ5/Projects/lazybones-0.8.3/project

Here template name is aem-multimodule-project, if we use any custom template then it will show below error.

If version entered is wrong, then we will get below error.


Press enter after entering the create command. Enter required info.


Note: Here create is the lazybone command, aem-multimodule-project is acs common template name for creating the project and aemtraining is the folder/directory name where i want to create my project. If target folder is not available then it creates this folder.


Build and Install Project
Run below command to install the lazybones project in aem
mvn clean install





By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.