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

    Copyright 2016-2018 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-web-servlet-filter-parent</artifactId>
  <version>0.4.0</version>
  <packaging>pom</packaging>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>Support for integrating OpenTracing in Web Servlet projects</description>
  <url>http://github.com/opentracing-contrib/java-web-servlet-filter</url>
  <inceptionYear>2016</inceptionYear>
  
  <scm>
    <url>https://github.com/opentracing-contrib/java-web-servlet-filter</url>
    <connection>scm:git:https://github.com/opentracing-contrib/java-web-servlet-filter.git</connection>
    <developerConnection>scm:git:https://github.com/opentracing-contrib/java-web-servlet-filter.git</developerConnection>
    <tag>0.4.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>

  <developers>
    <developer>
      <id>pavolloffay</id>
      <name>Pavol Loffay</name>
      <email>ploffay@redhat.com</email>
    </developer>
  </developers>

  <properties>

    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <main.basedir>${project.basedir}</main.basedir>

    <version.io.opentracing>0.33.0</version.io.opentracing>
    <version.javax.servlet-javax.servlet-api>3.1.0</version.javax.servlet-javax.servlet-api>
    <version.junit>4.12</version.junit>
    <version.org.mockito-mockito-all>1.10.19</version.org.mockito-mockito-all>
    <version.org.awaitility-awaitility>3.0.0</version.org.awaitility-awaitility>

    <!-- plugins -->
    <version.maven-deploy-plugin>2.8.2</version.maven-deploy-plugin>
    <version.maven-release-plugin>2.5.3</version.maven-release-plugin>
    <version.maven-source-plugin>3.0.1</version.maven-source-plugin>
    <version.maven-javadoc-plugin>2.10.4</version.maven-javadoc-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>
    <license-maven-plugin.version>3.0</license-maven-plugin.version>
  </properties>

  <modules>
    <module>opentracing-web-servlet-filter</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>opentracing-web-servlet-filter</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-util</artifactId>
        <version>${version.io.opentracing}</version>
      </dependency>
      <dependency>
        <groupId>io.opentracing</groupId>
        <artifactId>opentracing-mock</artifactId>
        <version>${version.io.opentracing}</version>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${version.junit}</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>${version.org.mockito-mockito-all}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

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

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

  <build>
    <pluginManagement>
      <plugins>
        <!-- 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>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${license-maven-plugin.version}</version>
          <configuration>
            <header>${main.basedir}/src/etc/header.txt</header>
            <mapping>
              <java>SLASHSTAR_STYLE</java>
            </mapping>
            <excludes>
              <exclude>.travis.yml</exclude>
              <exclude>.coveralls.yml</exclude>
              <exclude>.gitignore</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>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>compile</phase>
            </execution>
          </executions>
        </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-web-servlet-filter</packageName>
        </configuration>
      </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>
