<?xml version="1.0" encoding="UTF-8"?>
<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.spotify</groupId>
  <artifactId>missinglink-parent</artifactId>
  <version>0.2.2</version>
  <packaging>pom</packaging>

  <name>missinglink</name>

  <description>
    Missinglink scans the bytecode of dependency libraries to attempt to find problems
    (such as NoSuchMethodError) caused by conflicting versions that would otherwise only
    be found at runtime.
  </description>

  <url>https://github.com/spotify/missinglink</url>

  <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>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>

  <organization>
    <name>Spotify AB</name>
    <url>http://www.spotify.com</url>
  </organization>

  <developers>
    <developer>
      <id>liljencrantz</id>
      <name>Axel Liljencrantz</name>
      <email>liljencrantz@spotify.com</email>
    </developer>
    <developer>
      <id>krka</id>
      <name>Kristofer Karlsson</name>
      <email>krka@spotify.com</email>
    </developer>
    <developer>
      <id>mattbrown</id>
      <name>Matt Brown</name>
      <email>mattbrown@spotify.com</email>
    </developer>
    <developer>
      <id>pettermahlen</id>
      <name>Petter Måhlén</name>
      <email>petter@spotify.com</email>
    </developer>
    <developer>
      <id>dflemstr</id>
      <name>David Flemström</name>
      <email>dflemstr@spotify.com</email>
      <roles>
        <role>contributor</role>
      </roles>
    </developer>
  </developers>

  <modules>
    <module>benchmarks</module>
    <module>core</module>
    <module>maven-plugin</module>
  </modules>

  <properties>
    <!-- cobertura format needs to be xml for coveralls integration, but allow it to be specified
    as a property so it can be overridden to use html for anyone who wants to generate cobertura
    themselves from command-line -->
    <cobertura.format>xml</cobertura.format>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <scm>
    <connection>scm:git:git@github.com:spotify/missinglink.git</connection>
    <developerConnection>scm:git:git@github.com:spotify/missinglink.git</developerConnection>
    <url>https://github.com/spotify/missinglink</url>
    <tag>v0.2.2</tag>
  </scm>

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

  <prerequisites>
    <maven>3.0</maven>
  </prerequisites>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
            <useIncrementalCompilation>false</useIncrementalCompilation>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.1.1</version>
        <configuration>
          <configLocation>checkstyle.xml</configLocation>
          <consoleOutput>true</consoleOutput>
          <failOnViolation>true</failOnViolation>
          <failsOnError>true</failsOnError>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <maxAllowedViolations>0</maxAllowedViolations>
          <!-- make sure automatter generated classes are not checked by checkstyle -->
          <sourceDirectories>
            <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
          </sourceDirectories>
        </configuration>
        <executions>
          <execution>
            <id>checkstyle</id>
            <phase>process-classes</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <failOnViolation>true</failOnViolation>
              <failsOnError>true</failsOnError>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>8.20</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>3.0.5</version>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>pre-integration-test</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.eluder.coveralls</groupId>
        <artifactId>coveralls-maven-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <repoToken>${coveralls.token}</repoToken>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.7</version>
        <configuration>
          <format>${cobertura.format}</format>
          <!-- aggregated reports for multi-module projects -->
          <aggregate>true</aggregate>
          <instrumentation>
            <excludes>
              <exclude>com/spotify/missinglink/**/*Builder*.class</exclude>
              <!-- JMH benchmarks -->
              <exclude>com/spotify/missinglink/benchmarks/**/*</exclude>
              <exclude>org/openjdk/jmh/**/*</exclude>
            </excludes>
          </instrumentation>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.4</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>2.10.3</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
              <tagNameFormat>v@{project.version}</tagNameFormat>
              <pushChanges>true</pushChanges>
            </configuration>
            <dependencies>
              <dependency>
                <groupId>org.apache.maven.scm</groupId>
                <artifactId>maven-scm-provider-gitexe</artifactId>
                <version>1.9.4</version>
              </dependency>
            </dependencies>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
