3

We have encounter with an issue where we have two different features coming in a project that would be delivered with same released version.

For example-

Current released version of the project is 7.0.0.4 and there will two different feature implementation say parallel and caching feature in the project. Now we need to take out two branches for both for Caching and Parallel project features from trunk and both will be in active development, both features will be released on 7.0.0.7 release build of the project.
Maven coordinate like -

For Parallel feature

GroupId - com.tom.tomproject

artifactID - project

version - 7.0.0.7-SNAPSHOT

For Caching feature

GroupId - com.tom.tomproject

artifactID - project

version - 7.0.0.7-SNAPSHOT

Here SNAPSHOT version(7.0.0.7-SNAPSHOT) for both branches getting same, it will leads to ambiguity. What would be the good approch to resolve this.

Should I change groupID ? or is there any other way to resolve this issue ?

Afgan
  • 1,022
  • 10
  • 32

1 Answers1

4

If you want to build separate versions like that, use the version number to separate your branches, e.g.

7.0.0.7-Parallel-SNAPSHOT

and

7.0.0.7-Caching-SNAPSHOT
J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
  • It might also an approach to change the version number only according to feature something like `7.1.0.0-SNAPSHOT` for feature enhancement, `7.2.0.0-SNAPSHOT` for another feature...but in such cases I would recommend to keep semver versions numbers... – khmarbaise Feb 14 '18 at 10:24
  • @JF Meier Thanks for answer, but i have a doubt what if in case of CI i use LATEST as version for project dependency, what would be came in build path 7.0.0.7-Parallel-SNAPSHOT or 7.0.0.7-Caching-SNAPSHOT or which ever be latest among them. – Afgan Feb 14 '18 at 10:40
  • 1
    Firstly, LATEST is deprecated. If you want the latest version, use the versions-plugin to update the version. Secondly, in this case a thing like that cannot be done. If you develop on two different branches, there is no latest version, so it does not matter whether you change groupId, artifactId or version. – J Fabian Meier Feb 14 '18 at 11:02
  • Can we change groupId or more specifically is it recommended to change groupId in any scenario ? – Afgan Feb 14 '18 at 11:18
  • If you change something except the version numbers, then the artifacts appear completely unrelated for Maven. This e.g. means that you can accidentally put both on the classpath. Why would you like to change the groupId? – J Fabian Meier Feb 14 '18 at 11:55
  • Initially we were not taking SNAPSHOT version, for same case as in question we were changing groupId to segregate trunk from feature branch. Is it recommended ? is there any document to verify this. – Afgan Feb 14 '18 at 12:35
  • I never heard such a recommendation, but I doubt that there is an "official" document about this. – J Fabian Meier Feb 14 '18 at 12:41