Create two artifacts (war) for a single maven project

后端 未结 2 619
一生所求
一生所求 2021-01-28 09:34

I have a Java web project that we deploy on the server of two different customers, 99% of the code is the same, right now I have two ApplicationBuilders, which is the class that

2条回答
  •  难免孤独
    2021-01-28 09:56

    One way to approach this is to use the Maven WAR Plugin Overlays feature.

    Instead of trying to build multiple artifacts from one project (which can become unwieldy after a while), you create one base WAR project, and then a separate WAR project for each customer that only contains the components that need to be different.

    Each customer specific WAR will be overlaid with the base WAR. This will make it easier to customise not only the ApplicationBuilderFactory but also specific web content and assets.

    This also has the following benefits

    • customer specific features are guaranteed to be isolated from each other;

    • different customers can have their own release cycle and source control repository

    • it's easy to add subsequent customers

提交回复
热议问题