Maven commands for AEM | AEM Community Blog Seeding

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.8K

Likes

1.0K

Correct Reply

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.8K

Likes

1.0K

Correct Reply

1.1K
kautuk_sahni
Community Manager

23-11-2020

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.

AEM AEMEBlogSeeding Experience Manager

Replies

Avatar

Avatar

KiranVedantam1992

Avatar

KiranVedantam1992

KiranVedantam1992

02-12-2020

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

 

Thanks,

Kiran Vedantam.

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.8K

Likes

1.0K

Correct Reply

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.8K

Likes

1.0K

Correct Reply

1.1K
kautuk_sahni
Community Manager

02-12-2020

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