<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2016-2021 Talsma ICT

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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>

    <!-- Artifact identification -->
    <groupId>nl.talsmasoftware.context</groupId>
    <artifactId>context-propagation-root</artifactId>
    <version>1.0.10</version>
    <packaging>pom</packaging>

    <!-- Project information -->
    <name>Context propagation</name>
    <description>Standardized context propagation in concurrent systems.</description>
    <url>https://github.com/talsma-ict/context-propagation</url>
    <inceptionYear>2016</inceptionYear>

    <modules>
        <module>context-propagation-bom</module>
        <module>context-propagation</module>
        <module>context-propagation-java8</module>
        <module>context-propagation-metrics</module>
        <module>context-propagation-micrometer</module>
        <module>locale-context</module>
        <module>log4j2-propagation</module>
        <module>servletrequest-propagation</module>
        <module>slf4j-propagation</module>
        <module>spring-security-context</module>
        <module>opentracing-span-propagation</module>
    </modules>

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

    <organization>
        <name>Talsma ICT</name>
        <url>https://github.com/talsma-ict/</url>
    </organization>

    <developers>
        <developer>
            <id>sjoerd</id>
            <name>Sjoerd Talsma</name>
            <email>sjoerd@talsma-ict.nl</email>
            <url>https://github.com/sjoerdtalsma</url>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/talsma-ict/context-propagation.git</url>
        <connection>scm:git:git://github.com/talsma-ict/context-propagation.git</connection>
        <developerConnection>scm:git:https://github.com/talsma-ict/context-propagation.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.moduleName>${project.groupId}.${project.artifactId}</project.moduleName>
        <root.basedir>${project.basedir}</root.basedir>

        <metrics.version>4.2.3</metrics.version>
        <opentracing-api.version>0.33.0</opentracing-api.version>
        <spring-security.version>5.5.2</spring-security.version>
        <servlet-api.version>4.0.1</servlet-api.version>
        <slf4j.version>1.7.32</slf4j.version>
        <log4j2.version>2.14.1</log4j2.version>

        <junit.version>5.8.1</junit.version>
        <logback.version>1.2.6</logback.version>
        <hamcrest.version>2.2</hamcrest.version>
        <mockito.version>1.10.19</mockito.version>

        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>2.22.2</maven-failsafe-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
        <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <maven-scm-plugin.version>1.12.0</maven-scm-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <license-maven-plugin.version>4.1</license-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
        <coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
        <umldoclet.version>2.0.14</umldoclet.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <jdkToolchain>
                        <version>1.8</version>
                    </jdkToolchain>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven-failsafe-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Automatic-Module-Name>${project.moduleName}</Automatic-Module-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <executions>
                    <execution>
                        <id>generate-javadoc</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>aggregate-javadoc</id>
                        <goals>
                            <goal>aggregate-jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doclet>nl.talsmasoftware.umldoclet.UMLDoclet</doclet>
                    <docletArtifact>
                        <groupId>nl.talsmasoftware</groupId>
                        <artifactId>umldoclet</artifactId>
                        <version>${umldoclet.version}</version>
                    </docletArtifact>
                    <jdkToolchain>
                        <version>11</version>
                    </jdkToolchain>
                    <links>
                        <link>https://docs.oracle.com/en/java/javase/11/docs/api</link>
                        <link>https://www.slf4j.org/api</link>
                        <link>https://logging.apache.org/log4j/2.x/log4j-api/apidocs</link>
                        <link>https://metrics.dropwizard.io/4.0.0/apidocs</link>
                    </links>
                    <offlineLinks>
                        <offlineLink>
                            <url>https://javadoc.io/page/${project.groupId}/context-propagation-root/${project.version}</url>
                            <location>${root.basedir}/.mvn/javadoc</location>
                        </offlineLink>
                        <offlineLink>
                            <url>https://javadoc.io/page/io.opentracing/opentracing-api/${opentracing-api.version}</url>
                            <location>${root.basedir}/.mvn/javadoc/opentracing-api</location>
                        </offlineLink>
                        <offlineLink>
                            <url>https://javadoc.io/page/io.opentracing/opentracing-util/${opentracing-api.version}</url>
                            <location>${root.basedir}/.mvn/javadoc/opentracing-util</location>
                        </offlineLink>
                        <offlineLink>
                            <url>https://javadoc.io/page/org.springframework.security/spring-security-core/${spring-security.version}</url>
                            <location>${root.basedir}/.mvn/javadoc/spring-security-core</location>
                        </offlineLink>
                        <offlineLink>
                            <url>https://javadoc.io/page/javax.servlet/javax.servlet-api/${servlet-api.version}</url>
                            <location>${root.basedir}/.mvn/javadoc/servlet-api</location>
                        </offlineLink>
                        <offlineLink>
                            <url>https://www.javadoc.io/page/io.micrometer/micrometer-core/1.3.2</url>
                            <location>${root.basedir}/.mvn/javadoc/micrometer-core</location>
                        </offlineLink>
                    </offlineLinks>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>compile</phase>
                    </execution>
                </executions>
                <configuration>
                    <header>${root.basedir}/.mvn/license/header.txt</header>
                    <properties>
                        <owner>${project.organization.name}</owner>
                    </properties>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                    <excludes>
                        <exclude>.gitignore</exclude>
                        <exclude>.github/**</exclude>
                        <exclude>.mvn/**</exclude>
                        <exclude>mvnw*</exclude>
                        <exclude>etc/header.txt</exclude>
                        <exclude>**/.idea/**</exclude>
                        <exclude>LICENSE</exclude>
                        <exclude>**/*.md</exclude>
                        <exclude>src/test/resources/**</exclude>
                        <exclude>src/main/resources/**</exclude>
                    </excludes>
                    <strictCheck>true</strictCheck>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin-git</artifactId>
                        <version>${license-maven-plugin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>prepare-jacoco-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>${coveralls-maven-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>javax.xml.bind</groupId>
                        <artifactId>jaxb-api</artifactId>
                        <version>2.3.1</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus-staging-maven-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>${maven-scm-plugin.version}</version>
                <configuration>
                    <tag>${project.version}</tag>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- Test dependencies for all modules: -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency> <!-- Declare UML doclet version as provided dependency to get dependabot notifications -->
            <groupId>nl.talsmasoftware</groupId>
            <artifactId>umldoclet</artifactId>
            <version>${umldoclet.version}</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>snapshots</id>
            <name>OSS Sonatype Snapshot Repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
    </repositories>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <gpgArgument>--batch</gpgArgument>
                                        <gpgArgument>--pinentry-mode</gpgArgument>
                                        <gpgArgument>loopback</gpgArgument>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
