Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Change order of loading mutable contents

Avatar

Level 3

Hi.

We have a multisite project in AEM like this:

 

<project >

<groupId>com.adobe.aem.project</groupId>

<artifactId>main</artifactId>

<packaging>pom</packaging>

<version>1.0.0-SNAPSHOT</version>

<modules> <module>site1</module>

<module>site2</module>

<module>site3</module>

<module>site4</module>

<module>site5</module>

<module>dispatcher</module>

</modules>

</project>

 

In site1´s repoinit we are executing an operation that must be the first, before other sites execute their own repoinits

 

The problem is that the order is not the same in stage and production environments so our configuration is not been loaded in the right order.

 

Are there any way of priorize or choose the order in the load of this mutable contents?

 

Thanks in advance.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @katmandu25 
Yes, I meant adding dependency directly from POM not from package manager.

 

Package manager just for UI and manual package build.



Arun Patidar

View solution in original post

10 Replies

Avatar

Level 2

Hi @katmandu25  - Refer section 'Reactor Sorting' on this page - https://maven.apache.org/guides/mini/guide-multiple-modules.html

 

As explained, you need to define the dependency of site2, site3, site4, site5 modules on site1 module to let site1 module run first. Define your pom.xml of the respective module accordingly. Try something like below with Maven Invoker Plugin. 

 

<project>
<groupId>com.adobe.aem.project</groupId>
<artifactId>main</artifactId>
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>

<modules>
<module>site1</module>
<module>site2</module>
<module>site3</module>
<module>site4</module>
<module>site5</module>
<module>dispatcher</module>
</modules>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<projectsDirectory>site1</projectsDirectory>
<cloneProjectsTo>${project.build.directory}/invoker</cloneProjectsTo>
<pomIncludes>
<pomInclude>site1/pom.xml</pomInclude>
</pomIncludes>
</configuration>
<executions>
<execution>
<id>run-site1</id>
<goals>
<goal>run</goal>
</goals>
<phase>pre-integration-test</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Avatar

Level 3

Hi. Thank you for your response.

 

The reactor order is right. We don´t have the problem in building step. Our problem is in deployment step, that is, when AEM is loading the contents generated in the previous step. As I can see in the deploy_step.log 

 

[main] CONTAINER_STATUS 0
'/mnt/exchange/extract/fm.out/mutable-content-packages.csv' -> '/mnt/sandbox/packages.csv'
'/mnt/exchange/extract/mutable-content' -> '/mnt/sandbox/extract'
'/mnt/exchange/extract/mutable-content/com/package' -> '/mnt/sandbox/extract/com/package'
'/mnt/exchange/extract/mutable-content/com/package' -> '/mnt/sandbox/extract/com/package'
'/mnt/exchange/extract/mutable-content/com/package/site4' -> '/mnt/sandbox/extract/com/package/site4'
'/mnt/exchange/extract/mutable-content/com/package/site4/site4.ui.content' -> '/mnt/sandbox/extract/com/package/site4/site4.ui.content'

....

....

....

 

As you can see in this log site4 is the first in being installed in the deploy step, but I need site1 be the first.

 

Thanks in advance.

Avatar

Level 3

Hi. Thank you for your response. As I said in my last answer is not a problem with compile/build phase. The problem is when Adobe builts the image in the deployment phase. In this phase all packages are built (content, apps, config, core ....) and is here where I need to choose the order of loading.

 

Thanks in advance

Avatar

Community Advisor

HI @katmandu25 
The order can be decided based on dependency.

For example ui.apps package has dependency on core and ui.frontend which builds first.



Arun Patidar

Avatar

Level 3

Hi arunpatidar.

 

What you are saying is true, but when we are talking about a only project, but in my case I have more than one project or site, everyone has his own ui.apps, core, ui.frontend. The thing that I need is to choose the order of each project, not the order of their elements.

 

I hope you understand me. Look my pom in my first comment for illustrate you

Avatar

Community Advisor

Please take an example of core component where your project is depends on core component and core components installed first in AEM.

with Maven it is possible to handle the build sequence of any module or project, to manage the sequence for AEM installed, you need to add dependencies of site1 into other projects.

https://experienceleague.adobe.com/docs/experience-manager-65/content/sites/administering/contentman... 



Arun Patidar

Avatar

Level 3

Thank you for your response.

 

Unfortunatly I am in Cloud Manager and I am not using pPackage Manager at all. So I am afraid I can´t apply the solution you gave me.

 

However I have added the dependency in the general pom of each file and the pipeline takes into  account, so my software is now deploying right

Avatar

Correct answer by
Community Advisor

Hi @katmandu25 
Yes, I meant adding dependency directly from POM not from package manager.

 

Package manager just for UI and manual package build.



Arun Patidar

Avatar

Community Advisor

@katmandu25 

 

As @arunpatidar suggested, this can be dealt via dependencies. 

You just need to declare dependency of "site-1 repo-init module" in the "repo-init module of other projects".

 

This assures that site-1 is installed before site-2 


Aanchal Sikka