<?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>io.electrum</groupId>
  <artifactId>service-interface-base</artifactId>
  <version>2.0.3</version>
  <packaging>jar</packaging>
  <name>Service Interface Base</name>
  <description>Service Interface Base</description>
  <url>https://github.com/electrumpayments/service-interface-base</url>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Electrum Payments</name>
      <email>hello@electrum.io</email>
      <organization>Electrum Payments</organization>
      <organizationUrl>http://electrum.io</organizationUrl>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git@github.com:electrumpayments/service-interface-base.git</connection>
    <developerConnection>scm:git:git@github.com:electrumpayments/service-interface-base.git</developerConnection>
    <url>git@github.com:electrumpayments/service-interface-base.git</url>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <joda-time-version>2.9.4</joda-time-version>
    <swagger-version>1.5.9</swagger-version>
    <hibernate-validator-version>5.2.2.Final</hibernate-validator-version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>${joda-time-version}</version>
    </dependency>
    <dependency>
      <groupId>io.swagger</groupId>
      <artifactId>swagger-jersey2-jaxrs</artifactId>
      <version>${swagger-version}</version>
    </dependency>
    <dependency>
      <groupId>io.swagger</groupId>
      <artifactId>swagger-hibernate-validations</artifactId>
      <version>${swagger-version}</version>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-validator</artifactId>
      <version>${hibernate-validator-version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.4</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.kongchen</groupId>
        <artifactId>swagger-maven-plugin</artifactId>
        <version>3.1.3</version>
        <configuration>
          <apiSources>
            <apiSource>
              <springmvc>false</springmvc>
              <locations>io.electrum.vas.example.api</locations>
              <schemes>https</schemes>
              <host>sandbox.electrum.io</host>
              <basePath>/example/v2</basePath>
              <info>
                <title>Example Service Interface</title>
                <version>${project.version}</version>
                <description>This is an example of a VAS Service Interface. You can use this as a starting point for
                  writing vas service interfaces.
                </description>
                <contact>
                  <email>support@electrum.co.za</email>
                  <name>Electrum Support</name>
                  <url>http://io.electrum</url>
                </contact>
                <license>
                  <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
                  <name>Apache 2.0</name>
                </license>
              </info>
              <securityDefinitions>
                <securityDefinition>
                  <name>httpBasic</name>
                  <type>basic</type>
                  <description>All requests require HTTP basic authentication, where user name equals the value used in
                    sender.institution.id and password has been agreed with Electrum.
                  </description>
                </securityDefinition>
              </securityDefinitions>
              <templatePath>${basedir}/src/docs/devguide/handlebars-templates/swaggerfile.hbs</templatePath>
              <outputPath>${project.build.directory}/devguide/specification.md</outputPath>
              <outputFormats>yaml</outputFormats>
              <swaggerDirectory>${project.build.directory}/swagger</swaggerDirectory>
            </apiSource>
          </apiSources>
        </configuration>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.4.0</version>
        <executions>
          <execution>
            <id>build-devguide</id>
            <goals>
              <goal>exec</goal>
            </goals>
            <phase>post-integration-test</phase>
            <configuration>
              <executable>sh</executable>
              <arguments>
                <argument>run.sh</argument>
                <argument>${basedir}</argument>
              </arguments>
              <workingDirectory>${basedir}/src/docs/devguide/hugo/</workingDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jfrog.buildinfo</groupId>
        <artifactId>artifactory-maven-plugin</artifactId>
        <version>2.2.1</version>
        <inherited>false</inherited>
        <executions>
          <execution>
            <id>build-info</id>
            <goals>
              <goal>publish</goal>
            </goals>
            <configuration>
              <publisher>
                <contextUrl>${artifactory-url}/</contextUrl>
                <username>${artifactory-username}</username>
                <password>${artifactory-password}</password>
                <repoKey>oss-local</repoKey>
              </publisher>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
