A tiny Java library that allows for conveniently reading the version name of an application
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

versionName

Build Status Quality Gates Coverage Technical Debt

versionName is a tiny Java library that allows for conveniently reading the version name of an application from

  • Manifest or
  • property file.

Read more about it in those two blog posts

versionName consists of one class (as said before it's tiny) VersionNames that provides methods for reading the version name. The public methods return a String that is never null. In case of error, messages are written to a SLF4J-logger.

To use versionName, either copy VersionNames to your classpath or add the latest stable version to the dependency management tool of your choice.

With maven for example

<dependency>
    <groupId>de.triology.versionName</groupId>
    <artifactId>versionName</artifactId>
    <version>1.0.2</version>
</dependency>

Maven Central

You can also get snapshot versions from our snapshot repository (for the most recent commit on develop branch). To do so, add the following repo to your pom.xml or settings.xml:

<repository>
    <id>snapshots-repo</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    <releases><enabled>false</enabled></releases>
    <snapshots><enabled>true</enabled></snapshots>
</repository>

Examples

The examples show how to write a version name to your application using maven and how it can be read using the library from within applications (JAR or WAR). See examples/README.md

Jenkins

Running Jenkinsfile with the pipeline plugin (tested with version 2.4) requires

  • A JDK defined as Jenkins tool (see Jenkinsfile for name of JDK tool)
  • Maven defined as Jenkins tool (see Jenkinsfile for name of Maven tool)
  • Optional: You can add a build parameter RECIPIENTS that contains a comma-separated list of all email recipients