AEM Project Build & Deploy MVN Command Difference | Community
Skip to main content
Level 5
April 15, 2024
Solved

AEM Project Build & Deploy MVN Command Difference

  • April 15, 2024
  • 1 reply
  • 1371 views

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

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 EstebanBustamante

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/developer-tools/maven-plugin 

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

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

 

 

Hope this helps

 

1 reply

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
April 15, 2024

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/developer-tools/maven-plugin 

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

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

 

 

Hope this helps

 
Esteban Bustamante