Skip to content
Snippets Groups Projects
Select Git revision
  • 158e157be4ca026b280f44b4518a41770e441bb3
  • main default protected
  • release
  • create-gitlab-pipeline
  • OZG-7426-Dateitransfer-Eingang
  • OZG-7324-license-header-update
  • 4.16.0
  • 4.15.0
  • 4.14.0
  • 4.13.0
  • 4.12.0
  • 4.11.0
  • 4.10.0
  • 4.9.0
  • 4.8.0
  • 4.7.0
  • 4.6.0
  • 4.5.0
  • 4.4.0
  • 4.3.2
  • 4.3.1
  • 4.3.0
  • 4.2.0
  • 4.1.0
  • 4.0.1
  • 3.0.1
26 results

readme.md

Blame
  • 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>