Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


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,
  • property file or
  • from a constant generated by an annotation processor.

Reading from manifest or property file

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.

Read more about it in those two blog posts (Note that this refers to version 1.x and the maven coords and package names have changed since!)

With maven for example


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:


Alternative: Using the annotation processor

From a runtime perspective, its actually a bit odd reading a build-time constant from a file where it could just be "baked into" the application source code.

This misery can be ended using the VersionNameProcessor. It generates a constant Version.NAME (package, class and field name can be customized). With this mechanism there is not even the need for the com.cloudogu.versionName:versionName dependency.

In order to trigger the process, an annotation @VersioName must be set on a class or package. The Version class is then generated into the same package when the following dependency is added to the build (e.g. with maven):

    <!-- This dependency is only needed during compile time and should not be packaged into final JAR -->

Maven Central Using the provided scope will add zero dependencies to your project, only the generated class.

In addition, the version name to be written must be passed as an argument versionName to the compiler, e.g. like so using maven:


See also


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/


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


A tiny Java library that allows for conveniently reading the version name of an application




No packages published