<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2018 Royal Bank of Scotland
  ~
  ~ 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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.bluebank.braid</groupId>
    <artifactId>braid</artifactId>
    <version>3.1.6</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>braid-standalone-server</artifactId>
  <packaging>jar</packaging>
  <name>braid-standalone-server</name>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git://gitlab.com/bluebank/braid.git</connection>
    <developerConnection>scm:git:ssh://gitlab.com:bluebank/braid.git</developerConnection>
    <url>http://gitlab.com/bluebank/braid/tree/master</url>
  </scm>

  <developers>
    <developer>
      <name>Farzad Pezeshkpour</name>
      <email>fuzz@bluebank.io</email>
      <organization>Royal Bank of Scotland</organization>
      <organizationUrl>https://www.rbs.com</organizationUrl>
    </developer>
    <developer>
      <name>Chris Jones</name>
      <email>chris.jones@bluebank.io</email>
      <organization>Royal Bank of Scotland</organization>
      <organizationUrl>https://www.rbs.com</organizationUrl>
    </developer>
    <developer>
      <name>Ben Wyeth</name>
      <email>ben.wyeth@bluebank.io</email>
      <organization>Royal Bank of Scotland</organization>
      <organizationUrl>https://www.rbs.com</organizationUrl>
    </developer>
    <developer>
      <name>Mark Simpson</name>
      <email>mark.simpson@bluebank.io</email>
      <organization>Royal Bank of Scotland</organization>
      <organizationUrl>https://www.rbs.com</organizationUrl>
    </developer>
    <developer>
      <name>Ramiz Amad</name>
      <email>ramiz.amad@bluebank.io</email>
      <organization>Royal Bank of Scotland</organization>
      <organizationUrl>https://www.rbs.com</organizationUrl>
    </developer>
  </developers>

  <dependencies>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib-jre8</artifactId>
      <version>${kotlin.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-test-junit</artifactId>
      <version>${kotlin.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-unit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.module</groupId>
      <artifactId>jackson-module-kotlin</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.2.3</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-auth-shiro</artifactId>
      <version>${vertx.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-auth-common</artifactId>
      <version>${vertx.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-lang-kotlin</artifactId>
      <version>${vertx.version}</version>
    </dependency>
    <dependency>
      <groupId>io.reactivex</groupId>
      <artifactId>rxjava</artifactId>
      <version>${rxjava.version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.module</groupId>
      <artifactId>jackson-module-jsonSchema</artifactId>
    </dependency>
    <dependency>
      <groupId>io.bluebank.braid</groupId>
      <artifactId>braid-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>io.bluebank.braid</groupId>
      <artifactId>braid-client-js</artifactId>
      <version>${project.version}</version>
      <type>pom</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>src/main/kotlin</sourceDirectory>
    <testSourceDirectory>src/test/kotlin</testSourceDirectory>
    <finalName>${project.artifactId}</finalName>
    <resources>
      <resource>
        <directory>${project.build.sourceDirectory}/../resources</directory>
        <excludes>
          <exclude>**/service-scripts/**</exclude>
          <exclude>**/.vertx</exclude>
        </excludes>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>${project.build.testSourceDirectory}/../resources</directory>
        <excludes>
          <exclude>**/service-scripts/**</exclude>
          <exclude>**/.vertx</exclude>
          <exclude>**/node_modules/**</exclude>
        </excludes>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-maven-plugin</artifactId>
        <version>${kotlin.version}</version>
        <executions>
          <execution>
            <id>compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>test-compile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>test-compile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <jvmTarget>1.8</jvmTarget>
          <javaParameters>true</javaParameters>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>npm install (initialize)</id>
            <phase>initialize</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <exec executable="npm" dir="${project.basedir}/src/editor" failonerror="true">
                  <arg value="install"/>
                </exec>
              </target>
            </configuration>
          </execution>
          <execution>
            <id>npm run build</id>
            <phase>compile</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <exec executable="npm" dir="${project.basedir}/src/editor" failonerror="true">
                  <arg value="run"/>
                  <arg value="build"/>
                </exec>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <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>3.0.0-M1</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <reportSets>
          <reportSet>
            <inherited>false</inherited>
            <reports/>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>kr.motd.maven</groupId>
        <artifactId>sphinx-maven-plugin</artifactId>
        <version>2.2.2</version>
        <reportSets>
          <reportSet>
            <inherited>false</inherited>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>
</project>
