We have an in-house Java lib that is a dependency for many other projects, let's call it our-commons-<version>.jar. We like the idea of following semantic versioning more or less, so:
- Major number changes when we make backwards-incompatible API changes;
- Minor number changes when we make backwards-compatible API changes;
- Patch number changes every time we do a build (so for us, it's really a build number); but we really will only build when fixing a bug so its close enough to true
semver
Currently, we only publish to a SNAPSHOT directory on Artifactory, and overwrite the JAR that's there every time we build. Specifically, we have our project repo at:
http://arty/artifactory/simple/our-libs-snapshots/our-commons/snapshot
Where http://arty/artifactory is the Artifactory service running on the arty machine, where our-libs-snapshots is the name of the actual repo, and where our-commons is the name of our lib. The /snapshot dir is where all Bamboo builds publish to, like I said, overwriting the JAR each build. We are hardcoding our build to produce an our-commons-0.1-SNAPSHOT.jar each build.
To do this publishing, I have the following task configured as part of our Bamboo plan for our-commons:
Artifactory Deploy Task
=======================
Artifactory Serverl URL: http://arty/artifactory
Target Repository: our-libs-snapshots
Deployer Username: myadmin
Deployer Password: ******
Edit Published Artifacts: dist/our-commons-0.1-SNAPSHOT.jar=>our-commons/snapshot
Capture & Publish Build Info: yes (checked)
I'm trying to figure out how to get Bamboo and Artifactory working with our flavor of semver. Such that the first time we build, it will produce:
http://arty/artifactory/simple/our-libs-snapshots/our-commons/1.0.0/our-commons-1.0.0.jar
And the second time we build, it will produce:
http://arty/artifactory/simple/our-libs-snapshots/our-commons/1.0.1/our-commons-1.0.1.jar
Etc. Then, we would be able to manually indicate when we want to increase the minor number, in which case the patch number would start over again:
http://arty/artifactory/simple/our-libs-snapshots/our-commons/1.1.0/our-commons-1.1.0.jar
Same deal for major number, but incrementing that would reset both the minor and patch numbers.
Not sure where we should be adding this configurations should be added, or what they would actually look like. Any ideas?