We have to requirement to create a reparate branch of a part of your source tree (concretely a sub module) somtime when building the entire tree. We automated this with a profile in pom.xml of that sub-module where we configured branch goal as part of packag phase with something like this:
Unfortunately we faced two problems:
- Scm URL was not correctly handled for sub-module, acording path of module. This issue was already solved for Tagging in release preparation (see
MRELEASE-261). We ported the fix for branching.
- With actual implementation all projects of a reactor build are considered by branch goal. We solved this issue by filtering projects according their relative path.