OzgCloud Common license
This is a license provider for all OzgCloud Projects.
It uses the "license-maven-plugin".
It contains the header and full text of the german EUPL Version 1.2 license. The header file is templated to get the correct "year of introduction" for one specific file. The mechanism uses the Git history.
Note
Some developers have a license-header with a fixed "year-of-introduction" in their IDE (see project-setup). Running the plugin may overwrite this value (surprisingly) to a correct value from the Git History.
The recommendation is to use the (managed) preconfiguration which ideally suits every project. This config is part of OZG-Parent-Projects (common-lib or ozgcloud-common-parent).
The plugin may get executed:
- manually - When a developer has to (bulk-) update all files in a project
- Pre-Push-Hook - To make sure, all pushed files contain license headers
Commands
To add or update the license header to file run:
mvn license:format
To verify if there are files with missing license header run:
mvn license:check
Configuration
Use managed Version
Add inceptionYear to your project pom.xml:
<inceptionYear>2020</inceptionYear>
Add this section to your project main pom.xml:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
</plugins>
</pluginManagement>
</build>
It will include the preconfigured License-Plugin to your project.
Use custom version (older approach)
Caution
The preconfigured License-Plugin is extended to review Git-History to find the "Year of inception" for a file (see OZG-6839) If your custom configuration uses the provided header.txt, without the Git-Plugin, the year will be missing.
In your properties section of the pom.xml, add the current version of this:
<ozgcloud.license.version>1.8.0</ozgcloud.license.version>
In the plugins section add:
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>4.6</version>
<configuration>
<!-- Your custom configuration -->
</configuration>
<dependencies>
<dependency>
<groupId>de.ozgcloud.common</groupId>
<artifactId>ozgcloud-common-license</artifactId>
<version>${ozgcloud.license.version}</version>
</dependency>
</dependencies>
</plugin>