Build Versions Maven Plugin

Maven plugin for Semantic Versioning

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.nimworks
ArtifactId

ArtifactId

buildversions-maven-plugin
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Build Versions Maven Plugin
Maven plugin for Semantic Versioning
Project URL

Project URL

http://maven.apache.org
Project Organization

Project Organization

Neemworks Nigeria
Source Code Management

Source Code Management

https://github.com/Neemworks/buildversions-maven-plugin

Download buildversions-maven-plugin

How to add to project

<plugin>
    <groupId>com.nimworks</groupId>
    <artifactId>buildversions-maven-plugin</artifactId>
    <version>1.0.1</version>
</plugin>

Dependencies

compile (4)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 2.0
org.codehaus.plexus : plexus-utils jar 3.0.8
com.nimworks : nw.commons jar 2.0.0
org.apache.maven : maven-project jar 2.2.1

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.2

test (1)

Group / Artifact Type Version
junit : junit jar 4.8.2

Project Modules

There are no modules declared in this project.

Introduction

This plugin aims to automate the generation of semantic version numbers for your maven project.

Usage

  • Add the pluginto your pom.xml
<plugin>
        <groupId>com.nimworks</groupId>
        <artifactId>buildversion-maven-plugin</artifactId>
        <version>1.0.0</version>
        <executions>
          <execution>
            <id>buildversions</id>
            <phase>validate</phase>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
  • Do something with the generate version number For example
<groupId>com.nimworks.it</groupId>
  <artifactId>simple-it</artifactId>
  <version>${buildVersion}-SNAPSHOT</version>

  <description>A simple IT</description>

Builds are currently separated into 3 types

  • Major
  • Minor
  • Patch

The generated version takes the form {Major}.{Minor}.{Pathc}

Example

  • Build PATCH mvn clean package if this is the first run, it will generate app-1.0.0-SNAPSHOT.jar. Subsequent executions will only increment the patch version number (1.0.1, 1.0.2, etc). The example above is the same as running mvn clean package -Dbuild.type=PATCH

  • Build Minor Version mvn clean package -Dbuild.type=MINOR if this is the first run, it will generate app-1.1.0-SNAPSHOT.jar. Subsequent executions will only increment the patch version number (1.2.0, 1.3.0, etc). Notice that this mode will reset the patch versions to 0

com.nimworks

neemworks

Versions

Version
1.0.1
1.0.0