Skip to content

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):

<dependency>
    <groupId>com.cloudogu.versionName</groupId>
    <artifactId>processor</artifactId>
    <version>2.1.0</version>
    <!-- This dependency is only needed during compile time and should not be packaged into final JAR -->
    <scope>provided</scope>
</dependency>

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:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.0</version>
    <configuration>
        <compilerArgs>
            <arg>-AversionName=${versionName}</arg>
        </compilerArgs>
    </configuration>
</plugin>
Assets 2
You can’t perform that action at this time.