Skip to content
Snippets Groups Projects
Commit 8b701d94 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6839: Remove excludes, add file extensions, add documentation.

parent 7e795145
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@
* Update protoc-gen to 1.66
* Update Quarkus Platform to 3.13.3
* Update Keycloak Adapter to 24.0.5
* Update [OZGCloud License Generator](ozgcloud-common-license/readme.md)
### 4.3.2
* update mapstruct 1.5.5 -> 1.6.0
......
com.mycila# OzgCloud Common license
# OzgCloud Common license
This is a basic Maven-based project that can be used as license provider for all OzgCloud Projects
This is a license provider for all OzgCloud Projects.
It provides the the header and full text of the german [EUPL Version 1.2 license][license]
It uses the ["license-maven-plugin"](https://github.com/mathieucarbou/license-maven-plugin/).
It contains the header and full text of the german [EUPL Version 1.2 license](https://eupl.eu/1.2/de/). The header file is templated to get the correct "year of introduction" for one specific file. The mechanism uses the Git history.
## Usage
> [!NOTE]
> Some developers have a license-header with a *fixed* "year-of-introduction" in their IDE (see [project-setup](https://git.ozg-sh.de/ozgcloud-doc/dokumentation/src/branch/master/Entwicklungsumgebung#code-templates)). Running the plugin may overwrite this value (surprisingly) to a correct value from the Git History.
It is a library, meant to be included as a dependency on any project which may want to make use of it.
The recommendation is to use the (managed) preconfiguration which ideally suits every project. This config is part of OZG-Parent-Projects ([common-lib](../pom.xml) or [ozgcloud-common-parent](../ozgcloud-common-parent/pom.xml)).
To use it add
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:
```bash
mvn license:format
```
To verify if there are files with missing license header run:
```bash
mvn license:check
```
## Configuration
### Use managed Version
Add inceptionYear to your project pom.xml:
```xml
<inceptionYear>2020</inceptionYear>
```
Add this section to your project main pom.xml:
```xml
<ozgcloud.license.version>1.4.0</ozgcloud.license.version>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
</plugins>
</pluginManagement>
</build>
```
to the properties section of the pom.xml file.
It will include the preconfigured License-Plugin to your project.
In the plugins section add
### 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](https://jira.mgm-tp.com/jira/browse/OZG-6839))
> If your custom configuration uses the provided [header.txt](src/main/resources/license/eupl_v1_2_de/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:
```xml
<ozgcloud.license.version>1.8.0</ozgcloud.license.version>
```
In the plugins section add:
```xml
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>4.1</version>
<version>4.6</version>
<configuration>
<licenseSets>
<licenseSet>
<header>license/eupl_v1_2_de/header.txt</header>
<excludes>
<exclude>**/README</exclude>
<exclude>src/test/resources/**</exclude>
<exclude>src/main/resources/**</exclude>
<exclude>pom.xml</exclude>
</excludes>
</licenseSet>
</licenseSets>
<!-- Your custom configuration -->
</configuration>
<dependencies>
<dependency>
......@@ -45,21 +80,3 @@ In the plugins section add
</dependencies>
</plugin>
```
\ No newline at end of file
To add or update the license header to file run
```
mvn license:format
```
To verify if there are files with missing lisence header run
```
mvn license:check
```
For more information about the usage see the [Plugin Homepage][pluginHomePage]
## License
The project has been released under the [EUPL License][license].
[license]: https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
[pluginHomePage]: https://mycila.carbou.me/license-maven-plugin/
......@@ -91,15 +91,13 @@
<mapping>
<proto>SLASHSTAR_STYLE</proto>
<config>SCRIPT_STYLE</config>
<md>XML_STYLE</md>
<yml>SCRIPT_STYLE</yml>
<acss>JAVADOC_STYLE</acss>
</mapping>
<licenseSets>
<licenseSet>
<header>license/eupl_v1_2_de/header.txt</header>
<excludes>
<exclude>**/README</exclude>
<exclude>src/test/resources/**</exclude>
<exclude>src/main/resources/**</exclude>
</excludes>
</licenseSet>
</licenseSets>
</configuration>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment