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
Create 2 different Maven Profiles, one for each customer, that copies a version of class ApplicationBuilderFactory to the right directory before compile stage.
org.apache.maven.plugins
maven-antrun-plugin
1.7
copy-files
generate-sources
run
customer1
customer1
customer2i
customer2
Instead of having only one src/main/java/pkg/ApplicationBuilderFactory.java, we have:
So before compiling java code, we copy one of these versions to the src/main/java/pkg/ApplicationBuilderFactory.java.
So generate 2 different .wars using 2 different profiles.