This tool allows for automatic generation and bumping of CalVer or SemVer or custom version schemas. Motivational article: https://worklifenotes.com/2020/02/27/automatic-version-increments-with-reliza-hub-2-strategies/
- Generate CalVer or SemVer versions
- Bump CalVer or SemVer versions
- Flexibility in creating and managing different flavors of versioning schemas
- Usage as either Java Library or a CLI tool
java -jar versioning.jar -s YYYY.0M.Calvermodifier.Micro+Metadata -i Stable
or with docker:
docker run --rm relizaio/versioning -s YYYY.0M.Calvermodifier.Micro+Metadata -i Stable
java -jar versioning.jar -s semver -v 2.4.7 -a Bump
or with docker:
docker run --rm relizaio/versioning -s semver -v 2.4.7 -a Bump
2.3. Sample call inside Reliza Versioning itself to bump version in the project's pom file, with snapshot option (-t flag) set to true:
gradle changeVersion -PnewVersion="$(java -jar path_to_versioning\versioning.jar -s yyyy.0m.Calvermodifier.patch -i Stable -t True)"
or with docker:
gradle changeVersion -PnewVersion="$(docker run --rm relizaio/versioning -s yyyy.0m.Calvermodifier.patch -i Stable -t True)"
Note that this example is using versions-maven-plugin (that Reliza Versioning is using too).
Similarly, Reliza Versioning can be included into Jenkins by being called from the bash scripts.
docker run --rm relizaio/versioning -h
which will produce help summary page.
Note that in any usage case other than help page -s (schema) parameter is required.
Reliza Versioning understands following elements of versioning schema (case insensitive):
- Major
- Minor
- Micro (or Patch)
- Year (or YYYY) - 4-digit year presentation
- YY - 2-digit year presentation, if 1st digit is 0, only second digit is shown
- OY - 2 digit year presentation, if 1st digit is 0, it's still displayed as 0
- YYOM - 2-digit year presentation with month, i.e. 2103 is March, 2021
- YYYYOM - 4-digit year presentation with month, i.e. 202103 is March, 2021
- MM - 2-digit month presentation, if 1st digit is 0, only second digit is shown
- OM - 2-digit month presentation, if 1st digit is 0, it's still displayed as 0
- DD - 2-digit day presentation, if 1st digit is 0, only second digit is shown
- OD - 2-digit day presentation, if 1st digit is 0, it's still displayed as 0
- CIENV
- CIBUILD
- BRANCH - accepts any keyword, suggested for feature branch names
- MODIFIER - semver modifier (see note below), by convention separated by minus (-), if another separator is not specified
- CALVERMODIFIER - calver modifier (not to be used with SemVer)
- METADATA - can be used with both CalVer or SemVer, by convention separated by plus (+), if another separator is not specified
Dot (.), underscore(_) may be used as separators. Dash (-) or plus (+) may be used as separators once each specifically for modifier and metadata. We recommend using dash for modifier and plus for metadata as per SemVer conventions, which then would be treated by the tool as optional elements.
Note: for SemVer always use "modifier" notation, for CalVer still use "modifier" if it's used after -, i.e. YYYY.MM-modifier, but use calvermodifier in the dot notation, i.e. YYYY.MM.Calvermodifier.Patch
Reliza Versioning also understands "SemVer" as a code for "major.minor.patch-identifier+metadata" (where identifier and metadata are treated as optional).
docker pull relizaio/versioning
from the project directory run
gradle build
For Maven:
<dependency>
<groupId>io.reliza</groupId>
<artifactId>versioning</artifactId>
<version>2020.11.Stable.1</version>
</dependency>
For Gradle:
implementation 'io.reliza:versioning:2020.11.Stable.1'
See more options on the Maven Central page
from the project directory run
gradle build
Using Gradle: publish to maven local repository:
gradle publisToMavenLocal
And include resulting .jar file from the target directory in your project. Then use io.reliza.versioning.VersionApi class for most common operations. More documentation coming soon.
From the project directory run
Using gralde:
gradle test
Use methods exposed in the VersionApi class to create vresions. More documentation is coming soon.
This project is created and open-sourced by Reliza
This project is licensed under the MIT License - see the LICENSE file for details
- This project currently uses Java, Maven, Apache Commons and JUnit.