<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright (c) 2023. Roland T. Lichti, Kaiserpfalz EDV-Service.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>de.kaiserpfalz-edv.commons</groupId>
    <artifactId>kp-commons-root</artifactId>
    <version>4.0.0</version>
    <packaging>pom</packaging>

    <description>
        The kp-commons is a library that is used by the Kaiserpfalz EDV-Service for base integrations and common
        definitions like API base elements.
    </description>
    <name>${project.groupId}:${project.artifactId}</name>
    <url>https://kaiserpfalzedv.github.io/kp-commons/</url>

    <modules>
        <module>kp-commons-bom</module>
        <module>kp-checkstyle</module>
        <module>kp-commons-parent</module>
        <module>kp-spring-boot-parent</module>

        <module>core</module>
        <module>modules</module>
        <module>services</module>
    </modules>

    <inceptionYear>2001</inceptionYear>

    <licenses>
        <license>
            <name>GNU GENERAL PUBLIC LICENSE</name>
            <url>https://www.gnu.org/licenses/gpl-3.0.de.html</url>
            <distribution>repo</distribution>
            <comments>
                The GNU General Public License is a free, copyleft license for software and other kinds of works.
            </comments>
        </license>
    </licenses>

    <organization>
        <name>Kaiserpfalz EDV-Service</name>
        <url>https://www.kaiserpfalz-edv.de</url>
    </organization>

    <developers>
        <developer>
            <id>klenkes74</id>
            <name>Roland T. Lichti</name>
            <email>rlichti@kaiserpfalz-edv.de</email>
            <url>https://www.lichti.de</url>
            <roles>
                <role>Project Chair</role>
                <role>Developer</role>
                <role>sombody</role><!-- "'somebody' really should do ..." -->
            </roles>
            <properties>
                <picUrl>https://secure.gravatar.com/avatar/3b5c4008dc30b266341632f9931aab56</picUrl>
            </properties>

            <organization>Kaiserpfalz EDV-Service</organization>
            <organizationUrl>https://www.kaiserpfalz-edv.de</organizationUrl>
            <timezone>Europe/Berlin</timezone>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/KaiserpfalzEDV/kp-commons</url>
        <connection>scm:git:git://github.com/KaiserpfalzEDV/kp-commons</connection>
        <developerConnection>scm:git:git@github.com:KaiserpfalzEDV/kp-commons</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <issueManagement>
        <url>https://github.com/KaiserpfalzEDV/kp-commons/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <distributionManagement>
        <site>
            <id>gh-kaiserpfalzedv-kp-commons</id>
            <name>Kaiserpfalz EDV-Service -- KP-COMMONS</name>
            <url>scm:git:git@github.com:KaiserpfalzEDV/kp-commons.git</url>
        </site>
        <repository>
            <id>gh-kaiserpfalzedv-kp-commons</id>
            <name>GitHub Packages</name>
            <url>https://maven.pkg.github.com/KaiserpfalzEDV/kp-commons</url>
        </repository>
    </distributionManagement>

    <properties>
        <skipTests>false</skipTests>
        <skip.jar>false</skip.jar>
        <skip.javadoc>false</skip.javadoc>
        <skip.source>false</skip.source>
        <skip.site>false</skip.site>
        <skip.owasp>true</skip.owasp>

        <gpg.keyname>AF380360D648FC1D4BA7DBBA6A09445FE79CABD8</gpg.keyname>

        <scmpublish.scm.branch>gh-pages</scmpublish.scm.branch>
        <main.basedir>${project.basedir}</main.basedir>

        <maven.compiler.parameters>true</maven.compiler.parameters>
        <maven.compiler.release>17</maven.compiler.release>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.inputEncoding>UTF-8</project.reporting.inputEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <kp-commons.version>4.0.0</kp-commons.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.5.0</version>
                    <extensions>true</extensions>
                    <configuration>
                        <publishingServerId>kaiserpfalz-central</publishingServerId>
                        <autoPublish>true</autoPublish>
                        <waitUntil>published</waitUntil>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.2.4</version>
                    <configuration>
                        <gpgArguments>
                            <arg>--pinentry-mode</arg>
                            <arg>loopback</arg>
                        </gpgArguments>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.projectlombok</groupId>
                    <artifactId>lombok-maven-plugin</artifactId>
                    <version>1.18.20.0</version>
                    <configuration>
                        <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
                        <outputDirectory>${delombok.output}</outputDirectory>
                        <addOutputDirectory>false</addOutputDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>delombok</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>1.18.32</version>
                        </dependency>
                    </dependencies>
                </plugin>


                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.8.0</version>
                    <configuration>
                        <sourcepath>${delombok.output}</sourcepath>
                        <skip>${skip.javadoc}</skip>
                        <show>public</show>
                        <failOnError>false</failOnError>
                        <failOnWarnings>false</failOnWarnings>
                        <detectOfflineLinks>false</detectOfflineLinks>
                        <doclint>all,-missing</doclint>
                        <nohelp>true</nohelp>
                        <quiet>true</quiet>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadoc</id>
                            <phase>package</phase>
                            <goals>
                                <goal>javadoc</goal>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <propertiesEncoding>${project.build.sourceEncoding}</propertiesEncoding>
                        <delimiters>
                            <delimiter>@</delimiter>
                        </delimiters>
                        <useDefaultDelimiters>false</useDefaultDelimiters>
                        <nonFilteredFileExtensions>
                            <nonFilteredFileExtension>docx</nonFilteredFileExtension>
                            <nonFilteredFileExtension>xlsx</nonFilteredFileExtension>
                            <nonFilteredFileExtension>zip</nonFilteredFileExtension>
                            <nonFilteredFileExtension>tgz</nonFilteredFileExtension>
                            <nonFilteredFileExtension>png</nonFilteredFileExtension>
                            <nonFilteredFileExtension>jpg</nonFilteredFileExtension>
                            <nonFilteredFileExtension>gpg</nonFilteredFileExtension>
                            <nonFilteredFileExtension>license</nonFilteredFileExtension>
                        </nonFilteredFileExtensions>
                    </configuration>
                    <executions>
                        <execution>
                            <id>test-sources-generation</id>
                            <phase>generate-test-resources</phase>
                            <goals>
                                <goal>testResources</goal>
                            </goals>
                            <configuration>
                                <skip>${skipTests}</skip>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.12.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>3.3.1</version>
                    <configuration>
                        <configLocation>kaiserpfalz/checkstyle.xml</configLocation>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>de.kaiserpfalz-edv.commons</groupId>
                            <artifactId>kp-checkstyle</artifactId>
                            <version>${kp-commons.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>

                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>9.2.0</version>
                    <configuration>
                        <skip>${skip.owasp}</skip>
                        <suppressionFiles>
                            <suppressionFile>${main.basedir}/owasp-suppressions.xml</suppressionFile>
                        </suppressionFiles>
                        <failBuildOnCVSS>8</failBuildOnCVSS>
                        <assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
                        <failOnError>true</failOnError>
                        <nvdServerId>nvdApi</nvdServerId>
                        <verbose>true</verbose>
                        <nvdApiServerId>nvdApi</nvdApiServerId>
                        <inherit>false</inherit>
                        <msbuildAnalyzerEnabled>false</msbuildAnalyzerEnabled>
                        <nodeAnalyzerEnabled>false</nodeAnalyzerEnabled>
                        <pipfileAnalzerEnabled>false</pipfileAnalzerEnabled>
                        <nugetconfAnalyzerenabled>false</nugetconfAnalyzerenabled>
                        <skipSystemScope>true</skipSystemScope>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                    <id>enforce-maven</id>
                    <goals>
                        <goal>enforce</goal>
                    </goals>
                    <configuration>
                        <rules>
                        <requireMavenVersion>
                            <version>3.8</version>
                        </requireMavenVersion>
                        </rules>    
                    </configuration>
                    </execution>
                </executions>
                </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.5.0</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                            <report>dependencies</report>
                            <report>licenses</report>
                        </reports>
                    </reportSet>
                    <reportSet>
                        <id>aggregate</id>
                        <inherited>false</inherited>
                        <reports>
                            <report>index</report>
                            <report>dependencies</report>
                            <report>team</report>
                            <report>mailing-lists</report>
                            <report>ci-management</report>
                            <report>issue-management</report>
                            <report>licenses</report>
                            <report>scm</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <configLocation>kaiserpfalz/checkstyle.xml</configLocation>
                </configuration>
                <reportSets>
                    <reportSet>
                        <reports>
                            <!-- select non-aggregate reports -->
                            <report>checkstyle</report>
                        </reports>
                    </reportSet>
                    <reportSet>
                        <id>aggregate</id>
                        <inherited>false</inherited>
                        <reports>
                            <report>checkstyle-aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>3.3.2</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <!-- select non-aggregate reports -->
                            <report>jxr</report>
                            <report>test-jxr</report>
                        </reports>
                    </reportSet>
                    <reportSet>
                        <id>aggregate</id>
                        <inherited>false</inherited>
                        <reports>
                            <report>aggregate</report>
                            <report>test-aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.21.2</version>
                <configuration>
                    <linkXref>true</linkXref>
                    <inputEncoding>${project.reporting.inputEncoding}</inputEncoding>
                    <minimumTokens>100</minimumTokens>
                    <targetJdk>${maven.compiler.target}</targetJdk>
                    <excludeRoot>
                        <excludeRoot>target/generated-sources</excludeRoot>
                    </excludeRoot>
                    <reportSets>
                        <reportSet>
                            <reports>
                                <report>pmd</report>
                                <report>cpd</report>
                            </reports>
                        </reportSet>
                        <reportSet>
                            <id>aggregate</id>
                            <inherited>false</inherited>
                            <reports>
                                <report>aggergate-pmd</report>
                                <report>aggergate-cpd</report>
                            </reports>
                        </reportSet>
                    </reportSets>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.12</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <!-- select non-aggregate reports -->
                            <report>report</report>
                        </reports>
                    </reportSet>
                    <reportSet>
                        <id>aggregate</id>
                        <inherited>false</inherited>
                        <reports>
                            <report>report-aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>9.2.0</version>
                <configuration>
                    <suppressionFiles>
                        <suppressionFile>${main.basedir}/owasp-suppressions.xml</suppressionFile>
                    </suppressionFiles>
                    <skip>${skip.owasp}</skip>
                    <failBuildOnCVSS>8</failBuildOnCVSS>
                    <nvdApiServerId>nvdApi</nvdApiServerId>
                </configuration>
                <reportSets>
                    <reportSet>
                        <inherited>false</inherited>
                        <reports>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                    </plugin>

                    <plugin>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok-maven-plugin</artifactId>    
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                </plugins>  
            </build>
        </profile>
    </profiles>
</project>
