I am working on a Java project with Maven, where I need to deploy it very often in two different weblogic environments. The only differences between the two deployments are the totality of the changes in these two files: pom.xml and weblogic.xml . The remaining files are the same.
We create two GIT branches for this: dev and parallel-dev .
But we have a lot of problems with saving and merging changes between these two branches.
All changes are made in the parallel-dev branch, and as soon as this code is reviewed and approved, we merge it into the dev branch, except for those two files that do not need to be merged (if only the pom version is modified - in this case we only need to merge version change, but not the rest of the changes in pom.xml). This is a little dirty.
I think this method is rather confusing and can be improved, but cannot really see how to do it. I would just like to leave one branch for this process and avoid all these crazy mergers that we face.
Any advice would be highly appreciated.
- EDIT -
The difference in pom.xml is just another profile for the parallel dev branch:
<profiles> <profile> <id>parallel-dev</id> <activation> <activeByDefault>false</activeByDefault> </activation> <build> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> <resource> <directory>src/test/resources</directory> <filtering>true</filtering> <includes> <include>env.properties</include> <include>more.properties</include> ... </includes> </resource> </resources> <testResources> <testResource> <directory>src/test/resources</directory> <filtering>true</filtering> <excludes> <exclude>env.properties</exclude> <exclude>more.properties</exclude> ... </excludes> </testResource> </testResources> </build> </profile>
In weblogic.xml difference is name-context-root name and link to the library (this library also has parallel dev and dev branches).
source share