Skip to content

IntershopCommunicationsAG/extended-version

Repository files navigation

Extended Version Library

1. Summary

This library provides a simple access to a version object. It is based on the SemVer library and contains changes for specific requirements:

  • A complete version string may consist of the version number, the branch name and an additional build extension

    • See section Examples for details

  • A version number may consist of three as well four decimal numbers separated by a point

    • Examples: 10.1.0 or 10.1.0.2

  • The branch name must be different from the build extension! At the end of this string numbers are allowed, if they are separated through a minus.

    • Example: JIRA-4711

  • The extension is a combination of letters and numbers. It is allowed to separate letters and numbers by a point. The numbers must be located on the end of the string.

    • Examples: rc1, dev1, rc.1, dev.1

This version object gives you the possibility to handle the different parts of a version (normal, branchdata, builddata). Furthermore it is possible to compare version objects.

This is an example for the sequence of versions:
1.0.0 < 1.0.1 < 1.0.2-rc.1 < 1.0.2-rc.2 < 1.0.2

A complete version will be created even if only one or two digits are provided for the initialization.

10.0 → 10.0.0
10 → 10.0.0

It is also possible to get the original string from the parsed string. This will help to maintain versions like 1.1.

2. Examples

Release version with three digits

1.0.0

Release version with four digits

1.0.0.0

Milestone version of a feature branch

1.0.0-JIRA-4711-dev.1

Milestone release version

1.0.0-dev.1

Snapshot version

1.0.0.0-SNAPSHOT

3. Usage

Add the following line to your dependencies:

build.gradle
    compile 'com.intershop.gradle.version:extended-version:3.0.0'

For more information please check the provided Javadoc.

4. License

Copyright 2014-2016 Intershop Communications.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.