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

  <parent>
    <groupId>com.exonum.binding</groupId>
    <artifactId>exonum-java-binding-parent</artifactId>
    <version>0.8.0</version>
  </parent>

  <artifactId>exonum-java-binding-common</artifactId>
  <version>0.8.0</version>
  <packaging>jar</packaging>

  <name>Exonum Java Binding: Common</name>
  <description>
    A common library module for the Exonum core and Java clients,
    providing Exonum proofs, hashing and cryptographic operations,
    and serialization support.
  </description>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <lazysodium-java.version>4.0.1</lazysodium-java.version>
    <auto-value.version>1.6.6</auto-value.version>
    <jsonpath.version>2.4.0</jsonpath.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>

    <dependency>
      <groupId>com.goterl.lazycode</groupId>
      <artifactId>lazysodium-java</artifactId>
      <version>${lazysodium-java.version}</version>
    </dependency>

    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <!-- Optional for it is only needed for protobuf serializers support — if you don't
           use them, you don't need the protobuf. -->
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>com.google.auto.value</groupId>
      <artifactId>auto-value-annotations</artifactId>
      <version>${auto-value.version}</version>
    </dependency>

    <dependency>
      <groupId>com.google.auto.value</groupId>
      <artifactId>auto-value</artifactId>
      <version>${auto-value.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.ryanharter.auto.value</groupId>
      <artifactId>auto-value-gson-runtime</artifactId>
    </dependency>

    <dependency>
      <groupId>com.ryanharter.auto.value</groupId>
      <artifactId>auto-value-gson</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.exonum.binding</groupId>
      <artifactId>exonum-java-testing</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-testlib</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>nl.jqno.equalsverifier</groupId>
      <artifactId>equalsverifier</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.jayway.jsonpath</groupId>
      <artifactId>json-path-assert</artifactId>
      <version>${jsonpath.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>lazysodium</id>
      <url>https://dl.bintray.com/terl/lazysodium-maven</url>
    </repository>
  </repositories>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <goals>
              <goal>test-compile</goal>
            </goals>
            <configuration>
              <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <configLocation>${project.parent.basedir}/../checkstyle.xml</configLocation>
          <suppressionsLocation>${project.basedir}/checkstyle-suppressions.xml</suppressionsLocation>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>
            ${jacoco.args}
            ${java.vm.assertionFlag}
          </argLine>
          <excludedGroups>${excludeTags}, forked</excludedGroups>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <argLine>
            ${jacoco.it.args}
            ${java.vm.assertionFlag}
          </argLine>
          <includes>
            <include>**/*Test.java</include>
          </includes>
          <groups>forked</groups>
          <!-- Run each test class in its own VM -->
          <reuseForks>false</reuseForks>
        </configuration>
        <executions>
          <execution>
            <id>run-forked-its</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
    </plugins>
    <extensions>
      <!-- Use an extension that sets the OS classifier, required to locate
           the correct protoc executable -->
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>1.6.2</version>
      </extension>
    </extensions>
  </build>
</project>
