Expand my Community achievements bar.

SOLVED

Separating maven build and install in AEM

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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?lan...
  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.

View solution in original post

5 Replies

Avatar

Community Advisor

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.

 

 

Avatar

Level 2

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

Avatar

Community Advisor

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? 

Avatar

Level 2

The requirement is to save time in prod deployment. My team wants to save time in building the code base like keeping it prebuilt code and in the prod deployment window just install the package. But this we want to do through maven only without any manual addition or installation of package

Avatar

Correct answer by
Community Advisor

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?lan...
  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.