Separating maven build and install in AEM | Community
Skip to main content
Level 2
February 18, 2022
Solved

Separating maven build and install in AEM

  • February 18, 2022
  • 2 replies
  • 2317 views

Hi all,

 

I am looking for some way to seperate the local project build and installing the package in AEM.

I am looking for something to break into 2 steps.

The first step 
mvn clean install -DskipTests=true

which will prepare the zip files under target folders of ui apps and ui content and the bundle under core.

Then second step
-PautoinstallPackage which can install my zips as well as the bundle to AEM without building it again.

 

Is it possible to do it like this?

Any help will be appreciated.


Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lukasz-m

Hi @user05300, you can try one of below option to achieve your goal.

  1. Create simple bash script that will upload and install package using curl and Package Manger API, https://experienceleague.adobe.com/docs/experience-manager-65/administering/operations/curl.html?lang=en#package-management
  2. Use Maven CRX plugin - https://github.com/wttech/Maven-CRX-Plugin - as far as I remember this plugin does not require package to be build every time, so you can easily split your process into package build and package upload/installation.

2 replies

B_Sravan
Community Advisor
Community Advisor
February 18, 2022

Hi @user05300 ,

 

I don't think you could execute a maven command without goals.
you can either just build it (mvn clean install) or build and install (mvn clean install -PautoInstallPackage).

 

if you wan't to be in separate ways, you could build first and then manually install packages through package manager.
Thank you.

 

 

user05300Author
Level 2
February 18, 2022

Hi @b_sravan 

 

Goals are already there in my parent pom. 
I don't want to install the packages manually.
Any way to just build the codebase in 1st step and deploy the packages in the 2nd step.
Thanks

B_Sravan
Community Advisor
Community Advisor
February 18, 2022

Hi @user05300 ,

 

I was mentioning the goals on the command (clean and install).
If you don't want to install them manually and wanted in two steps,

1: Build it --> mvn clean install

2: Install --> mvn install -PautoInstallPackage. (this will still build the project again but doesn't clean the existing packages).

I wonder why you want to split a single step in to two, may I know the context? 

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
February 18, 2022

Hi @user05300, you can try one of below option to achieve your goal.

  1. Create simple bash script that will upload and install package using curl and Package Manger API, https://experienceleague.adobe.com/docs/experience-manager-65/administering/operations/curl.html?lang=en#package-management
  2. Use Maven CRX plugin - https://github.com/wttech/Maven-CRX-Plugin - as far as I remember this plugin does not require package to be build every time, so you can easily split your process into package build and package upload/installation.