<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <artifactId>vertx-pairtree</artifactId>
  <packaging>jar</packaging>
  <version>0.0.2</version>
  <name>Vert.x Pairtree</name>
  <description>A Pairtree library for Vert.x</description>
  <url>http://projects.freelibrary.info/vertx-pairtree</url>

  <licenses>
    <license>
      <name>The MIT License (Expat)</name>
      <url>https://opensource.org/licenses/MIT</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:ksclarke/vertx-pairtree.git</connection>
    <developerConnection>scm:git:git@github.com:ksclarke/vertx-pairtree.git</developerConnection>
    <url>git@github.com:ksclarke/vertx-pairtree.git</url>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/ksclarke/vertx-pairtree/issues</url>
  </issueManagement>

  <developers>
    <developer>
      <email>ksclarke@ksclarke.io</email>
      <name>Kevin S. Clarke</name>
      <url>http://kevinclarke.info</url>
      <roles>
        <role>developer</role>
      </roles>
      <timezone>America/New_York</timezone>
    </developer>
  </developers>

  <properties>
    <!-- These values, needed by integration tests, can be supplied via command line or settings.xml file -->
    <vertx.pairtree.bucket />
    <vertx.pairtree.access_key />
    <vertx.pairtree.secret_key />
    <vertx.pairtree.region />

    <!-- Dependency versions -->
    <vertx.hot.plugin.version>2.1.0</vertx.hot.plugin.version>
    <codacy.plugin.version>1.0.2</codacy.plugin.version>
    <aws.sdk.version>1.11.22</aws.sdk.version>
    <vertx.version>3.4.0</vertx.version>
  </properties>

  <dependencies>
    <!-- Project dependencies -->
    <dependency>
      <groupId>info.freelibrary</groupId>
      <artifactId>freelib-utils</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
      <version>${vertx.version}</version>
    </dependency>
    <!-- Below dependencies are only used for testing -->
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-unit</artifactId>
      <version>${vertx.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-s3</artifactId>
      <version>${aws.sdk.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- Generate our MessageCodes class from the messages resource file -->
      <plugin>
        <groupId>info.freelibrary</groupId>
        <artifactId>freelib-utils</artifactId>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>generate-codes</goal>
            </goals>
            <configuration>
              <generatedSourcesDirectory>${project.basedir}/src/main/generated</generatedSourcesDirectory>
              <messageFiles>
                <messageFile>src/main/resources/pairtree_messages.xml</messageFile>
              </messageFiles>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>io.dazraf</groupId>
        <artifactId>vertx-hot-maven-plugin</artifactId>
        <version>${vertx.hot.plugin.version}</version>
        <configuration>
          <verticleReference>info.freelibrary.pairtree.PairtreeVerticle</verticleReference>
          <systemPropertyVariables>
            <vertx.logger-delegate-factory-class-name>io.vertx.core.logging.SLF4JLogDelegateFactory</vertx.logger-delegate-factory-class-name>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <sourcepath>src/main/java:src/main/generated</sourcepath>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <configuration>
          <!-- An issue with vertx-hot prevents us from using this (https://github.com/dazraf/vertx-hot/issues/39) -->
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.gavinmogan</groupId>
        <artifactId>codacy-maven-plugin</artifactId>
        <version>${codacy.plugin.version}</version>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/*IT.java</exclude>
            <exclude>**/*IntegrationTest.java</exclude>
          </excludes>
          <systemPropertyVariables>
            <vertx.port>${vertx.port}</vertx.port>
            <vertx.logger-delegate-factory-class-name>io.vertx.core.logging.SLF4JLogDelegateFactory</vertx.logger-delegate-factory-class-name>
          </systemPropertyVariables>
          <argLine>${jacoco.agent.arg}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>br.com.ingenieux</groupId>
        <artifactId>jbake-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <configuration>
          <portNames>
            <portName>vertx.port</portName>
          </portNames>
        </configuration>
        <executions>
          <execution>
            <id>reserve-port</id>
            <phase>initialize</phase>
            <goals>
              <goal>reserve-network-port</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <!-- S3 integration tests can be run if an AWS/S3 access_key and private_key are supplied -->
  <profiles>
    <profile>
      <id>s3_it</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <vertx.pairtree.bucket>${vertx.pairtree.bucket}</vertx.pairtree.bucket>
                <vertx.pairtree.access_key>${vertx.pairtree.access_key}</vertx.pairtree.access_key>
                <vertx.pairtree.secret_key>${vertx.pairtree.secret_key}</vertx.pairtree.secret_key>
                <vertx.pairtree.region>${vertx.pairtree.region}</vertx.pairtree.region>
                <vertx.port>${vertx.port}</vertx.port>
              </systemPropertyVariables>
              <argLine>${jacoco.agent.arg}</argLine>
              <includes>
                <include>**/*IT.java</include>
                <include>**/*IntegrationTest.java</include>
              </includes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <!-- Enables pushing project documentation up to an S3 bucket -->
  <distributionManagement>
    <site>
      <id>s3.site</id>
      <url>s3://projects.freelibrary.info/vertx-pairtree</url>
    </site>
  </distributionManagement>

  <!-- Pulls in standard FreeLibrary Project configuration options -->
  <parent>
    <artifactId>freelib-parent</artifactId>
    <groupId>info.freelibrary</groupId>
    <version>0.1.9</version>
  </parent>

</project>
