Search code examples
svnmavenmaven-release-plugin

Is there a way to use maven to automate feature branch reintegration?


Say you have a project that uses maven and a subversion repository. It consists of quite a lot of modules. So far, development happened in trunk, but now feature branches are to be introduced. This has to be as painless as possible considering all developers on the team should start using feature branches.

So, to create a branch, you use the release plugin which conveniently creates a branch for you, changes the version numbers of all module poms correctly and even updates the <scm> section in the parent pom.

Now, if you want to reintegrate the feature branch to trunk, there is no matching functionality in the release plugin -- you have to do everything by hand:

  • Merge with reintegrate flag
  • Change the version number in all poms
  • Change the <scm> section manually
  • Commit

This is not only cumbersome but also error prone if done by hand every time (and this might be frequent when using feature branches extensively). I know that at least the second point could be automated using release:update-versions or version:set, but there has to be more, right? What am I missing?


Solution

  • There's no really good way to do that with the maven release plugin. Your best bet is to do the merge with just subversion (merge feature branch into trunk) and then eventually release off the trunk again.