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
Branches
Tags
No related merge requests found
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
* Update protoc-gen to 1.66 * Update protoc-gen to 1.66
* Update Quarkus Platform to 3.13.3 * Update Quarkus Platform to 3.13.3
* Update Keycloak Adapter to 24.0.5 * Update Keycloak Adapter to 24.0.5
* Update [OZGCloud License Generator](ozgcloud-common-license/readme.md)
### 4.3.2 ### 4.3.2
* update mapstruct 1.5.5 -> 1.6.0 * 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 ```xml
<ozgcloud.license.version>1.4.0</ozgcloud.license.version> <inceptionYear>2020</inceptionYear>
``` ```
to the properties section of the pom.xml file.
In the plugins section add Add this section to your project main pom.xml:
```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](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 ```xml
<plugin> <plugin>
<groupId>com.mycila</groupId> <groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId> <artifactId>license-maven-plugin</artifactId>
<version>4.1</version> <version>4.6</version>
<configuration> <configuration>
<licenseSets> <!-- Your custom configuration -->
<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>
</configuration> </configuration>
<dependencies> <dependencies>
<dependency> <dependency>
...@@ -44,22 +79,4 @@ In the plugins section add ...@@ -44,22 +79,4 @@ In the plugins section add
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
``` ```
To add or update the license header to file run \ No newline at end of file
```
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 @@ ...@@ -91,15 +91,13 @@
<mapping> <mapping>
<proto>SLASHSTAR_STYLE</proto> <proto>SLASHSTAR_STYLE</proto>
<config>SCRIPT_STYLE</config> <config>SCRIPT_STYLE</config>
<md>XML_STYLE</md>
<yml>SCRIPT_STYLE</yml>
<acss>JAVADOC_STYLE</acss>
</mapping> </mapping>
<licenseSets> <licenseSets>
<licenseSet> <licenseSet>
<header>license/eupl_v1_2_de/header.txt</header> <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> </licenseSet>
</licenseSets> </licenseSets>
</configuration> </configuration>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment