Search code examples
configurationprojectmagnolia

Separate author&public mvn projects or standard Magnolia bundle?


What are the pros and cons between creating a custom bundle that has separate author and public webapps in a bundle and the standard bundle that has only one complete webapp (magnoliaAuthor) that is then partially copied to create the second webapp (magnoliaPublic)?

Considerations should be made for a typical setup, for example a web shop with lots of integration. Recommended characteristics to consider: security, ease of understanding the project structure/neatness, ease of development - code reuse.


Solution

  • PRO: Having it separately is more appropriate if we might want to install some modules on the author instance only as they are relevant only to authors, or when they are in some way perceived as security-critical and not desired on the public instance.

    CON: If different wars are required for the two environments then you would have to use that approach, but that is not ideal for a typical setup. It's possible to secure a module from starting on public by checking the flag. Every module has a module class where you can control how and when a module should be started. It's not necessary to bloat the package to have author and public instances. The standard is to have a single war with multiple configurations. Starting from scratch, with an empty mangolia bundle you get this setup, to get separate a&p mvn projects, you have to duplicate the empty webapp project and customize them to obtain a separate public&author.

    Relevant docs: