Expand my Community achievements bar.

SOLVED

AEM Project Build & Deploy MVN Command Difference

Avatar

Level 5

Hi Team

 

Can you please help difference between these maven commands for build & deploy the AEM Project.

 

1) What is exactly doing when we run the profile adobe-public & when we need to use this command or adobe-public profile?
mvn clean install -Padobe-public

2) what is difference between profilesautoInstallSinglePackage(all/pom.xml) vs autoInstallPackage(root/pom.xml) ?
mvn clean install  -PautoInstallSinglePackage vs mvn clean install -PautoInstallPackage

3) I am using below command to build and deploy each module level, but module (ex:ui-apps or ui-config)) level pom xml don't have this profile, How it's working & Is it right way to build & deploy each module using below command?
mvn clean install -PautoInstallPackage

 

Regards

Vara

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi
Overall, the maven profile just wrap configurations, so the best way to understand them is to look at the pom and check what configurations are available by each profile. Let me try to answer your question super quick.

  1. "mvn clean install -Padobe-public". This command runs the clean and install phases using the profile 'Adobe Public', which behind the scenes utilizes the Adobe public repository to download Maven dependencies regardless of the repositories you may have declared in your .m2 file.

  2. When you run 'mvn clean install', Maven will execute the configurations present in the POM file located at the same level where the command is executed. Therefore, it's important to note that the 'autoInstallSinglePackage' profile only exists under the 'all/pom.xml'. Essentially, both commands achieve the same result, so they can be used interchangeably.

  3. Yes, this is the traditional command to deploy the code: 'mvn clean install -PautoInstallPackage'. Since this command is triggered from the 'root' POM, it will execute the pom from their children as well. This particular profile is used to indicate to the 'content-package-maven-plugin' where (i.e., which server) to install the packages generated during the build process.

 

This is a brief explanation. If you want to dive deeper, you can check the links below:

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/dev... 

https://maven.apache.org/guides/introduction/introduction-to-profiles.html

https://experienceleague.adobe.com/en/docs/experience-manager-core-components/using/developing/arche... 

 

 

Hope this helps

 


Esteban Bustamante

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi
Overall, the maven profile just wrap configurations, so the best way to understand them is to look at the pom and check what configurations are available by each profile. Let me try to answer your question super quick.

  1. "mvn clean install -Padobe-public". This command runs the clean and install phases using the profile 'Adobe Public', which behind the scenes utilizes the Adobe public repository to download Maven dependencies regardless of the repositories you may have declared in your .m2 file.

  2. When you run 'mvn clean install', Maven will execute the configurations present in the POM file located at the same level where the command is executed. Therefore, it's important to note that the 'autoInstallSinglePackage' profile only exists under the 'all/pom.xml'. Essentially, both commands achieve the same result, so they can be used interchangeably.

  3. Yes, this is the traditional command to deploy the code: 'mvn clean install -PautoInstallPackage'. Since this command is triggered from the 'root' POM, it will execute the pom from their children as well. This particular profile is used to indicate to the 'content-package-maven-plugin' where (i.e., which server) to install the packages generated during the build process.

 

This is a brief explanation. If you want to dive deeper, you can check the links below:

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/dev... 

https://maven.apache.org/guides/introduction/introduction-to-profiles.html

https://experienceleague.adobe.com/en/docs/experience-manager-core-components/using/developing/arche... 

 

 

Hope this helps

 


Esteban Bustamante