<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>com.spt-development</groupId>
    <artifactId>spt-development-cid</artifactId>
    <version>2.0.15</version>

    <name>cid</name>
    <description>A very simple library for getting/setting the current correlation ID, utilising ThreadLocal.</description>
    <url>https://github.com/spt-development/spt-development-cid</url>

    <scm>
        <connection>scm:git:https://github.com/spt-development/spt-development-cid.git</connection>
        <url>https://github.com/spt-development/spt-development-cid</url>
      <tag>2.0.15</tag>
  </scm>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <packaging>jar</packaging>

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

        <maven.compiler.release>17</maven.compiler.release>

        <!-- Maven version -->
        <maven.min.version>3.9.4</maven.min.version>

        <!-- Dependency versions -->
        <!-- None -->

        <!-- Test dependency versions -->
        <hamcrest.version>2.2</hamcrest.version>
        <junit-jupiter.version>5.10.3</junit-jupiter.version>

        <!-- Plugin versions -->
        <build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
        <checkstyle-maven-plugin.version>3.5.0</checkstyle-maven-plugin.version>
        <dependency-check-maven.version>10.0.4</dependency-check-maven.version>
        <jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
        <license-maven-plugin.version>2.4.0</license-maven-plugin.version>
        <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
        <maven-dependency-plugin.version>3.8.0</maven-dependency-plugin.version>
        <maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
        <maven-gpg-plugin.version>3.2.6</maven-gpg-plugin.version>
        <maven-javadoc-plugin.version>3.10.0</maven-javadoc-plugin.version>
        <maven-jxr-plugin.version>3.5.0</maven-jxr-plugin.version>
        <maven-pmd-plugin.version>3.25.0</maven-pmd-plugin.version>
        <maven-release-plugin.version>3.1.1</maven-release-plugin.version>
        <maven-scm-plugin.version>2.1.0</maven-scm-plugin.version>
        <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>3.5.0</maven-surefire-plugin.version>
        <nexus-staging-plugin.version>1.7.0</nexus-staging-plugin.version>
        <pitest-maven.version>1.17.0</pitest-maven.version>
        <spotbugs.version>4.8.6.4</spotbugs.version>
        <versions-maven-plugin.version>2.17.1</versions-maven-plugin.version>

        <!-- Plugin dependencies -->
        <checkstyle.version>10.18.1</checkstyle.version>
        <findbugs-slf4j-bug-pattern.version>1.5.0</findbugs-slf4j-bug-pattern.version>
        <findbugs-sec-bug-pattern.version>1.12.0</findbugs-sec-bug-pattern.version>
        <pitest-junit5-plugin.version>1.2.1</pitest-junit5-plugin.version>
        <pmd.version>7.5.0</pmd.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Test BOMs -->
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit-jupiter.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Third-party dependencies -->
        <!-- None -->

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
            <!-- Version defined in junit bom, imported in dependencyManagement section -->
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
            <!-- Version defined in junit bom, imported in dependencyManagement section -->
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <!-- Plugins used in custom profiles, added so that new versions are detected by the versions plugin -->
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>${maven-pmd-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>net.sourceforge.pmd</groupId>
                            <artifactId>pmd-core</artifactId>
                            <version>${pmd.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>net.sourceforge.pmd</groupId>
                            <artifactId>pmd-java</artifactId>
                            <version>${pmd.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>net.sourceforge.pmd</groupId>
                            <artifactId>pmd-javascript</artifactId>
                            <version>${pmd.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>net.sourceforge.pmd</groupId>
                            <artifactId>pmd-jsp</artifactId>
                            <version>${pmd.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${license-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.pitest</groupId>
                    <artifactId>pitest-maven</artifactId>
                    <version>${pitest-maven.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.pitest</groupId>
                            <artifactId>pitest-junit5-plugin</artifactId>
                            <version>${pitest-junit5-plugin.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>${build-helper-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>parse-version</id>
                        <goals>
                            <goal>parse-version</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <showWarnings>true</showWarnings>
                    <compilerArgs>
                        <arg>-Xlint:all</arg>
                        <arg>-Xlint:-processing</arg>
                        <arg>-Werror</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven-dependency-plugin.version}</version>
                <executions>
                    <execution>
                        <id>analyze</id>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                        <configuration>
                            <failOnWarning>true</failOnWarning>
                            <ignoreNonCompile>true</ignoreNonCompile>
                            <ignoreAllNonTestScoped>true</ignoreAllNonTestScoped>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <dependencyConvergence />
                                <requireFilesExist>
                                    <files>
                                        <!-- Minimum set of documentation required -->
                                        <file>${project.basedir}/README.md</file>
                                        <file>${project.basedir}/documentation/releases/release-${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.md</file>
                                    </files>
                                </requireFilesExist>
                                <requireMavenVersion>
                                    <version>${maven.min.version}</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle-maven-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <violationSeverity>warning</violationSeverity>
                </configuration>
                <executions>
                    <execution>
                        <id>google-checks</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <configLocation>google_checks.xml</configLocation>
                            <suppressionsLocation>config/checkstyle/google_checks_suppressions.xml</suppressionsLocation>
                        </configuration>
                    </execution>
                    <execution>
                        <id>spt-checks</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <configLocation>config/checkstyle/spt_checks.xml</configLocation>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <trimStackTrace>false</trimStackTrace>
                    <includes>
                        <include>**/*Tests.java</include>
                        <include>**/*Test.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/*IT.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>${spotbugs.version}</version>
                <configuration>
                    <effort>Max</effort>
                    <threshold>Low</threshold>
                    <xmlOutput>false</xmlOutput>
                    <plugins>
                        <plugin>
                            <groupId>jp.skypencil.findbugs.slf4j</groupId>
                            <artifactId>bug-pattern</artifactId>
                            <version>${findbugs-slf4j-bug-pattern.version}</version>
                        </plugin>
                        <plugin>
                            <groupId>com.h3xstream.findsecbugs</groupId>
                            <artifactId>findsecbugs-plugin</artifactId>
                            <version>${findbugs-sec-bug-pattern.version}</version>
                        </plugin>
                    </plugins>
                    <excludeFilterFile>${project.basedir}/config/findbugs/findbugs-exclude.xml</excludeFilterFile>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <rule>
                                    <element>CLASS</element>
                                    <limits>
                                        <limit>
                                            <counter>LINE</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>1.0</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>${dependency-check-maven.version}</version>
                <configuration>
                    <!-- Assembly analyzer disabled because we don't have any .NET code/dlls -->
                    <assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
                    <!-- Node and retirejs analyzer disabled, because any js floating around isn't part of the main app -->
                    <nodeAnalyzerEnabled>false</nodeAnalyzerEnabled>

                    <failBuildOnCVSS>0</failBuildOnCVSS>
                    <suppressionFiles>
                        <suppressionFile>${project.basedir}/config/owasp/suppress.xml</suppressionFile>
                    </suppressionFiles>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <configuration>
                    <outputFile>${project.build.directory}/dependency-versions.txt</outputFile>
                    <rulesUri>file:///${project.basedir}/config/versions/version-rules.xml</rulesUri>
                </configuration>
                <version>${versions-maven-plugin.version}</version>
            </plugin>
            <plugin>
                <artifactId>maven-scm-plugin</artifactId>
                <version>${maven-scm-plugin.version}</version>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <goals>deploy</goals>
                    <scmCommentPrefix>[skip ci] [maven-release-plugin] </scmCommentPrefix>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
    </build>

    <profiles>
        <profile>
            <!-- Additional quality gates not run by default when executing mvn clean verify, but are run by CI pipeline -->
            <id>all-quality-gates</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.pitest</groupId>
                        <artifactId>pitest-maven</artifactId>
                        <configuration>
                            <mutationThreshold>100</mutationThreshold>
                        </configuration>
                        <executions>
                            <execution>
                                <id>mutation-testing</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>mutationCoverage</goal>
                                </goals>
                            </execution>
                        </executions>
                        <!-- Version defined in pluginManagement section -->
                    </plugin>
                    <plugin>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <configuration>
                            <includeTests>false</includeTests>
                            <printFailingErrors>true</printFailingErrors>
                            <rulesets>
                                <ruleset>config/pmd/rulesets/spt-default-rules.xml</ruleset>
                                <ruleset>config/pmd/rulesets/spt-main-rules.xml</ruleset>
                            </rulesets>
                        </configuration>
                        <executions>
                            <execution>
                                <id>pmd-main-check</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>pmd-test-check</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>pmd</goal>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <targetDirectory>${project.build.directory}/pmdTest/</targetDirectory>
                                    <includeTests>true</includeTests>
                                    <excludeRoots>
                                        <excludeRoot>${basedir}/src/main/java</excludeRoot>
                                    </excludeRoots>
                                    <rulesets>
                                        <ruleset>config/pmd/rulesets/spt-default-rules.xml</ruleset>
                                        <ruleset>config/pmd/rulesets/spt-test-rules.xml</ruleset>
                                    </rulesets>
                                </configuration>
                            </execution>
                            <execution>
                                <id>cpd-check</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>cpd-check</goal>
                                </goals>
                            </execution>
                        </executions>
                        <!-- Version defined in pluginManagement section -->
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>compile</phase>
                                <goals>
                                    <goal>add-third-party</goal>
                                </goals>
                                <configuration>
                                    <failOnBlacklist>true</failOnBlacklist>
                                    <licenseMerges>
                                        <!-- Aggregate different ways to write acceptable licenses -->
                                        <licenseMerge>CC0 1.0 Universal (CC0 1.0) Public Domain Dedication|
                                            Public Domain, per Creative Commons CC0
                                        </licenseMerge>
                                        <licenseMerge>Eclipse Distribution License - v1.0|
                                            Eclipse Distribution License - v 1.0
                                        </licenseMerge>
                                        <licenseMerge>Eclipse Public License - v1.0|
                                            Eclipse Public License 1.0|Eclipse Public License - v 1.0|EDL 1.0
                                        </licenseMerge>
                                        <licenseMerge>Eclipse Public License - v2.0|
                                            Eclipse Public License 2.0|Eclipse Public License v2.0|EPL 2.0|
                                            Eclipse Public License - v 2.0
                                        </licenseMerge>
                                        <licenseMerge>The 2-Clause BSD License|BSD-2-Clause
                                        </licenseMerge>
                                        <licenseMerge>The 3-Clause BSD License|BSD License 3|BSD-3-Clause
                                        </licenseMerge>
                                        <licenseMerge>The Apache Software License, Version 2.0|Apache2|
                                            Apache-2.0|Apache 2|APL2|Apache 2.0|Apache License, Version 2.0|
                                            The Apache License, Version 2.0|Apache Software License - Version 2.0|
                                            the Apache License, ASL Version 2.0|ASL 2.0|Apache License 2.0|ASL, version 2
                                        </licenseMerge>
                                        <licenseMerge>The MIT License|
                                            MIT license|The MIT License (MIT)|MIT License|MIT|MIT-style
                                        </licenseMerge>
                                    </licenseMerges>
                                    <includedLicenses>
                                        <!-- To get an idea of risk, see - https://www.synopsys.com/blogs/software-security/top-open-source-licenses/ -->
                                        <includedLicense>CC0 1.0 Universal (CC0 1.0) Public Domain Dedication</includedLicense>
                                        <includedLicense>Eclipse Distribution License - v1.0</includedLicense>
                                        <includedLicense>Eclipse Public License - v1.0</includedLicense>
                                        <includedLicense>Eclipse Public License - v2.0</includedLicense>
                                        <includedLicense>The 2-Clause BSD License</includedLicense>
                                        <includedLicense>The 3-Clause BSD License</includedLicense>
                                        <includedLicense>The Apache Software License, Version 2.0</includedLicense>
                                        <includedLicense>The MIT License</includedLicense>
                                    </includedLicenses>
                                </configuration>
                            </execution>
                        </executions>
                        <!-- Version defined in pluginManagement section -->
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                        <!-- Version defined in pluginManagement section -->
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <!-- Version defined in pluginManagement section -->
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <!-- Version defined in pluginManagement section -->
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                        <!-- Version defined in pluginManagement section -->
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <reporting>
        <plugins>
            <plugin>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>${maven-jxr-plugin.version}</version>
            </plugin>
        </plugins>
    </reporting>

    <developers>
        <developer>
            <name>Simon Taylor</name>
            <email>simon.taylor@spt-development.com</email>
            <organizationUrl>http://www.spt-development.com</organizationUrl>
        </developer>
    </developers>

    <distributionManagement>
        <site>
            <id>github</id>
            <url>https://github.com/spt-development/spt-development-cid</url>
        </site>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>
</project>
