diff --git a/README.md b/README.md index 0b91c350e33eb3b6ac84a2c89a9ace25b230d0e8..7c4cc844ac69852dbe879535801fd31ed25e94a5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,10 @@ ## Changelog -### 4.4.0-SNAPSHOT +### 4.6.0-SNAPSHOT +* Update [OZGCloud License Generator](ozgcloud-common-license/readme.md) + +### 4.4.0 * Integration SBOM in JAR-File (OZG-4833) * Update to Spring-Boot 3.3.4 * Update netdev.grpc Spring-Boot Starter to 3.1.0-RELEASE diff --git a/ozgcloud-common-license/readme.md b/ozgcloud-common-license/readme.md index c471a27f5c0752fa04206b506656f5b7d1902187..b3524b92763895809d95a537771c1651b947e27d 100644 --- a/ozgcloud-common-license/readme.md +++ b/ozgcloud-common-license/readme.md @@ -1,40 +1,75 @@ -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 -<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 <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> @@ -44,22 +79,4 @@ In the plugins section add </dependency> </dependencies> </plugin> -``` -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/ +``` \ No newline at end of file diff --git a/pom.xml b/pom.xml index 1c2c2bb48d2ff9c767793c097df6dddc8d899277..1337e4edb6678539240fa41bf34dd78b899e19aa 100644 --- a/pom.xml +++ b/pom.xml @@ -91,17 +91,18 @@ <mapping> <proto>SLASHSTAR_STYLE</proto> <config>SCRIPT_STYLE</config> + <md>XML_STYLE</md> </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> + <excludes> + <exclude>**/.angular/cache/**</exclude> + <exclude>**/.nx/**</exclude> + <exclude>**/node_modules/**</exclude> + </excludes> </configuration> <dependencies> <dependency>