Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Maven commands for AEM | AEM Community Blog Seeding

kautuk_sahni
Community Manager
Community Manager

BlogImage.jpg

Maven commands for AEM by Kiran Vedantam

Abstract

 

What is Maven: Maven is an automation tool used to build and deploy the code for java applications. All the maven commands are supposed to be run in the command prompt (of course 😁)

How to check your maven version:

To run all the below mentioned commands, you need to have maven installed in your system (Pre-requisite 🤦 ). To check the version of your maven,

“mvn -v”

AEM and Maven:

In AEM maven is used to clean, build and install the code into different AEM instances. In this blog we will see various useful maven commands.

Cleaning the target directory code:

mvn clean

Cleaning and installing the code to a local repository:

mvn clean install

Note:

Generic maven commands are part of Maven life cycle [Ex: install]. They usually does not install your code in AEM. We need to use specific Maven plug-ins to achieve that.

Installing package (including bundle) into AEM instance:

mvn clean install -PautoInstallPackage

Installing only bundle into AEM instance:

mvn clean install -PautoInstallBundle

Adding the release version for your package via maven command:

mvn clean install -PautoInstallPackage -drelease.version=1.0.0

Skipping the unit tests written in java code during build:

Package build: mvn clean install -PautoInstallPackage -DskipTests
Bundle build: mvn clean install -PautoInstallBundle -DskipTests
Adding the profile in maven command:

mvn clean install -PautoInstallPackage -padobe-public

To build a single package:

mvn clean install -PbuildSinglePackage

To build and install single package on an AEM instance:

mvn clean install -PbuildSinglePackage -PautoInstallSinglePackage

Read Full Blog

Maven commands for AEM

Q&A

Please use this thread to ask the related questions.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies
Kiran_Vedantam
Community Advisor
Community Advisor

Thanks, @kautuk_sahni  for sharing this. Can you please update it with the latest commands?

 

Thanks,

Kiran Vedantam.

kautuk_sahni
Community Manager
Community Manager

Thank you for writing this wonderful article. Keep the wonderful AEM community work going. Participate more here. I have also Update the content.