AEM Project Creation – Maven

Aa part of earlier blog we created a AEM project using AEM Maven archetype. Please follow this link for more information.

Before code deployment, we require to create a brand new AEM instance. To install and configure AEM please follow this link.

Now, Its time time to deploy aem project on AEM instance.

Command1: Below command will help us to clean all the modules and delete target folders.

mvn clean install

Command2: Below command will help us to deploy code in AEM author instance. autoInstallPackage and other profiles will get generate at the time of project creation in main pom.xml. Below command will create a zip file of html, css, .jar and other resources and install same in AEM author instance.

mvn clean install -PautoInstallPackage

Command3: Below command will help us to deploy code in AEM publish instance. As mentioned earlier, autoInstallPackagePublish profile will get generate at the time of project creation in main pom.xml. Below command will also create a zip file of html, css, .jar and other resources and install same in AEM author instance.

mvn clean install -PautoInstallPackagePublish

Command 4: Below command will deploy only java code as jar file in the form of bundle.

mvn clean install -PautoInstallBundle

Code Deployment

Traverse to project root practice folder and use below command to deploy code as part of current deployment. It will create a zip file of html, css, .jar and other resources and install same in AEM author instance.

mvn clean install -PautoInstallPackage

It will show below success messages for all sub modules.

Hit http://localhost:4502/crx/packmgr/index.jsp URL and verify all below installed packages.

Below are the project related required packages which always needs to be install once build is successfully done.

practice.ui.content-1.0.0-SNAPSHOT.zip
practice.ui.apps-1.0.0-SNAPSHOT.zip
practice.ui.config-1.0.0-SNAPSHOT.zip
practice.all-1.0.0-SNAPSHOT.zip

Hit http://localhost:4502/crx/de/index.jsp URL and verify highlighted code structure is present or not inside /apps/practice folder.

For successful build, It is always require to verify installed bundle / jar file just after build. Its status muse be active.

http://localhost:4502/system/console/bundles

Imran Khan, Adobe Community Advisor, AEM certified developer and Java Geek, is an experienced AEM developer with over 11 years of expertise in designing and implementing robust web applications. He leverages Adobe Experience Manager, Analytics, and Target to create dynamic digital experiences. Imran possesses extensive expertise in J2EE, Sightly, Struts 2.0, Spring, Hibernate, JPA, React, HTML, jQuery, and JavaScript.

0