AEM Project - Double Code Base in the same AEM overwrite bundles

Avatar

Avatar

tommyc11112341

Avatar

tommyc11112341

tommyc11112341

13-05-2020

Hi at all, how is the best practices?

Use Case:

- 2 project in AEM, every project have his own code base (basically equal)

- On deploy each code base on AEM will overwrite the bundle of the other project

 

How is possible to deploy or merge the two code base for not overwrite the each other project bundle?

 

Thanks

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Theo_Pendle

MVP

Avatar

Theo_Pendle

MVP

Theo_Pendle
MVP

14-05-2020

Hi @tommyc11112341,

If your 2 sites are very similar, then you may need something like this:

projects.png

Just like you would do in any project, you should identify the shared code and extract it to a dependency that both your projects share. This way:

  1. No risk of conflict between bundles
  2. In the future if you need to change your code, you can likely do it once as opposed to doing it in sitea and siteb
  3. Less code deployed overall = less complexity

If you're not sure how to do this, please see the WKND Tutorial which will teach you how to use AEM Core Components as a dependency, then do the same in your projects 🙂

Answers (1)

Answers (1)

Avatar

Avatar

Ankur_Khare

MVP

Avatar

Ankur_Khare

MVP

Ankur_Khare
MVP

13-05-2020

First of all this is not the best practice to have such kind of code base.

Still you need to have such kind of stuff-

then you need to change package in one of the bundle so that both the bundles not interfere with other.

 

And you need to update corresponding references in html codes as well.

 

Note: This is not recommended.