Expand my Community achievements bar.

SOLVED

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

Avatar

Level 2

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

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 10

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 

View solution in original post

5 Replies

Avatar

Community Advisor

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.

Avatar

Level 2
Hi @Ankur_Khare I know this is not the best practice, I'm try to convince one customer partner in redesign the entire codebase, but probably they works out of our Best Practice

Avatar

Correct answer by
Level 10

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 

Avatar

Level 2
Hi @Theo_Pendle thanks for the diagram. I advice on this practice the customers partner for redesign the codebase in they way you describe.