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

    Copyright 2016-2020 The OpenTracing Authors

    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>

  <groupId>io.opentracing.contrib</groupId>
  <artifactId>opentracing-spring-web-parent</artifactId>
  <version>4.1.0</version>
  <packaging>pom</packaging>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>Support for integrating OpenTracing in Spring Web applications</description>
  <url>https://github.com/opentracing-contrib/java-spring-web</url>

  <scm>
    <url>https://github.com/opentracing-contrib/java-spring-web</url>
    <connection>scm:git:https://github.com/opentracing-contrib/java-spring-web.git</connection>
    <developerConnection>scm:git:https://github.com/opentracing-contrib/java-spring-web.git</developerConnection>
    <tag>4.1.0</tag>
  </scm>

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

  <inceptionYear>2016</inceptionYear>

  <developers>
    <developer>
      <id>pavolloffay</id>
      <name>Pavol Loffay</name>
      <email>p.loffay@gmail.com</email>
    </developer>
  </developers>

  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <main.basedir>${project.basedir}</main.basedir>

    <version.org.awaitility-awaitility>4.0.3</version.org.awaitility-awaitility>
    <version.io.opentracing>0.33.0</version.io.opentracing>
    <version.io.opentracing.contrib-opentracing-web-servlet-filter>0.4.0</version.io.opentracing.contrib-opentracing-web-servlet-filter>
    <version.io.opentracing.contrib-opentracing-tracerresolver>0.1.8</version.io.opentracing.contrib-opentracing-tracerresolver>
    <version.io.opentracing.contrib-opentracing-spring-tracer-configuration-starter>0.3.1</version.io.opentracing.contrib-opentracing-spring-tracer-configuration-starter>
    <version.junit>4.13.1</version.junit>
    <version.org.mockito-mockito-core>2.23.4</version.org.mockito-mockito-core>
    <version.org.springframework.boot>2.3.4.RELEASE</version.org.springframework.boot>
    <!-- Should match version from https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-dependencies/pom.xml  -->
    <version.org.springframework>5.2.9.RELEASE</version.org.springframework>
    <version.com.github.tomakehurst-wiremock-jre8>2.21.0</version.com.github.tomakehurst-wiremock-jre8>
    <version.io.projectreactor.netty-reactor-netty>0.9.12.RELEASE</version.io.projectreactor.netty-reactor-netty>

    <!-- plugins -->
    <version.maven-deploy-plugin>2.8.2</version.maven-deploy-plugin>
    <version.maven-license-plugin>3.0</version.maven-license-plugin>
    <version.maven-jar-plugin>3.0.2</version.maven-jar-plugin>
    <version.maven-javadoc-plugin>2.10.4</version.maven-javadoc-plugin>
    <version.maven-release-plugin>2.5.3</version.maven-release-plugin>
    <version.maven-source-plugin>3.0.1</version.maven-source-plugin>
    <version.io.takari-maven>0.3.4</version.io.takari-maven>
    <version.io.zikin.centralsync-maven-plugin>0.1.0</version.io.zikin.centralsync-maven-plugin>
  </properties>

  <modules>
    <module>opentracing-spring-web</module>
    <module>opentracing-spring-web-starter</module>
    <module>opentracing-spring-web-itest</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>opentracing-spring-web</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>io.opentracing</groupId>
        <artifactId>opentracing-api</artifactId>
        <version>${version.io.opentracing}</version>
      </dependency>
      <dependency>
        <groupId>io.opentracing</groupId>
        <artifactId>opentracing-noop</artifactId>
        <version>${version.io.opentracing}</version>
      </dependency>
      <dependency>
        <groupId>io.opentracing</groupId>
        <artifactId>opentracing-mock</artifactId>
        <version>${version.io.opentracing}</version>
      </dependency>

      <dependency>
        <groupId>io.opentracing.contrib</groupId>
        <artifactId>opentracing-web-servlet-filter</artifactId>
        <version>${version.io.opentracing.contrib-opentracing-web-servlet-filter}</version>
      </dependency>

      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${version.org.springframework.boot}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${version.junit}</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${version.org.mockito-mockito-core}</version>
      </dependency>

      <dependency>
        <groupId>org.awaitility</groupId>
        <artifactId>awaitility</artifactId>
        <version>${version.org.awaitility-awaitility}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${version.org.mockito-mockito-core}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${version.junit}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <distributionManagement>
    <repository>
      <id>bintray</id>
      <url>https://api.bintray.com/maven/opentracing/maven/opentracing-spring-web/;publish=1</url>
    </repository>
    <snapshotRepository>
      <id>jfrog-snapshots</id>
      <url>http://oss.jfrog.org/artifactory/oss-snapshot-local</url>
    </snapshotRepository>
  </distributionManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${version.maven-license-plugin}</version>
        </plugin>
        <!-- mvn -N io.takari:maven:wrapper -Dmaven=3.5.0 -->
        <plugin>
          <groupId>io.takari</groupId>
          <artifactId>maven</artifactId>
          <version>${version.io.takari-maven}</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>${version.maven-release-plugin}</version>
        <configuration>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <tagNameFormat>@{project.version}</tagNameFormat>
        </configuration>
      </plugin>
      <plugin>
        <groupId>io.zipkin.centralsync-maven-plugin</groupId>
        <artifactId>centralsync-maven-plugin</artifactId>
        <version>${version.io.zikin.centralsync-maven-plugin}</version>
        <configuration>
          <subject>opentracing</subject>
          <repo>maven</repo>
          <packageName>opentracing-spring-web</packageName>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${version.maven-license-plugin}</version>
        <configuration>
          <header>${main.basedir}/header.txt</header>
          <failIfMissing>true</failIfMissing>
          <failIfUnknown>true</failIfUnknown>
          <excludes>
            <exclude>LICENSE</exclude>
            <exclude>mvnw</exclude>
            <exclude>mvnw.cmd</exclude>
            <exclude>travis/publish.sh</exclude>
            <exclude>.mvn/wrapper/maven-wrapper.properties</exclude>
            <exclude>**/*.factories</exclude>
            <exclude>**/TracingClientResponseMono.java</exclude>
            <exclude>**/TracingClientResponseSubscriber.java</exclude>
            <exclude>**/TracingExchangeFilterFunction.java</exclude>
            <exclude>**/TracingWebClientBeanPostProcessor.java</exclude>
            <exclude>**/TracingOperator.java</exclude>
            <exclude>**/TracingSubscriber.java</exclude>
            <exclude>**/TracingWebFilter.java</exclude>
          </excludes>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin-git</artifactId>
            <version>${version.maven-license-plugin}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>compile</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <!-- Creates source jar -->
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>${version.maven-source-plugin}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <!-- Creates javadoc jar -->
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${version.maven-javadoc-plugin}</version>
            <configuration>
              <failOnError>false</failOnError>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <phase>package</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
