开发者

Working with multiple maven projects and multiple branches

开发者 https://www.devze.com 2022-12-21 03:54 出处:网络
All, currently I have following maven projects all stored in svn: Common-Test v1.0                    

All,

currently I have following maven projects all stored in svn:

  1. Common-Test v1.0                               -> svn:repo/Common-Test/trunk
  2. Common-Core v3.1 (depends on 1)     -> svn:repo/Common-Core/trunk
  3. PM-Web v3.1 (depends on 2)               -> svn:repo/PM-Web/trunk

Now, I need to create a branch since v3.1 is installed in production and we want to start development for v4.0. I am not sure about he best way to handle this:

  1. should I simply create a branch of every project and increase the version? I don't think so since for instance Common-Test will probably not change so why increase the version?

    However, if for some reason a change in Common-Test is required then the danger is there that we accidentaly make the change in v1.0 instead of creating a new version and a n开发者_如何学运维ew branch.

  2. In svn: should I group the 3 projects into 1 remote folder and create a branch of that folder?

This is probably is common situation so I was wondering which procedures are out there...

thanks,

Stijn


Should I simply create a branch of every project and increase the version?

Something close indeed. Since you have released your PM-Web project (and its dependencies), you need to take a "snapshot" (in case you need to change things) and I would tag each project to do so (don't branch if you don't need to):

  1. Common-Test v1.0 -> svn:repo/Common-Test/tags/common-test-1.0
  2. Common-Core v3.1 (depends on 1) -> svn:repo/Common-Core/tags/common-core-3.1
  3. PM-Web v3.1 (depends on 2) -> svn:repo/PM-Web/tags/pm-web-3.1

With everything in th POM updated accordingly (versions, scm, version in dependencies, etc).

If later you need to fix something on the released version, create a branch from the tagged version, e.g.

  1. Common-Test v1.0.1 -> svn:repo/Common-Test/branches/common-test-1.x
  2. Common-Core v3.1 (depends on 1)
  3. PM-Web v3.1.1 (depends on 2) -> svn:repo/PM-Web/branches/pm-web-3.1.x

Make the fix in the branches and release the new version (and retag).

And development of the next version occurs in the trunk (note that nothing forces you to do any change in the incremented version of Common-Test nor to release it if you don't need to, but since you released the previous version, the version in the trunk should be changed):

  1. Common-Test v1.1-SNAPSHOT -> svn:repo/Common-Test/trunk
  2. Common-Core v3.2-SNAPSHOT (depends on 1) -> svn:repo/Common-Core/trunk
  3. PM-Web v3.2-SNAPSHOT (depends on 2) -> svn:repo/PM-Web/trunk

For your information, the Maven Release Plugin can help to automate these steps.

In svn: should I group the 3 projects into 1 remote folder and create a branch of that folder?

I don't think so. Your projects seems to have separated life-cycle so it makes sense in my opinion to have separate modules (i.e. separate hierarchy with separate trunk/tags/branches) for them.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号