<?xml version="1.0"?>
<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>
  <artifactId>nflow-tests</artifactId>
  <name>nflow-tests</name>
  <description>nFlow integration tests</description>
  <url>http://nflow.io</url>
  <organization>
    <name>Nitor Creations</name>
    <url>http://www.nitorcreations.com</url>
  </organization>
  <parent>
    <groupId>io.nflow</groupId>
    <artifactId>nflow-root</artifactId>
    <version>5.3.2</version>
  </parent>
  <dependencies>
    <dependency>
      <groupId>io.nflow</groupId>
      <artifactId>nflow-jetty</artifactId>
    </dependency>
    <dependency>
      <groupId>io.nflow</groupId>
      <artifactId>nflow-metrics</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-client</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-joda</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.swagger2markup</groupId>
      <artifactId>swagger2markup</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
    </dependency>
    <dependency>
      <groupId>com.microsoft.sqlserver</groupId>
      <artifactId>mssql-jdbc</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>ru.yandex.qatools.embed</groupId>
      <artifactId>postgresql-embedded</artifactId>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>pentaho-repo</id>
      <name>pentaho-repo</name>
      <url>https://public.nexus.pentaho.org/content/groups/omni/</url>
    </repository>
  </repositories>
  <profiles>
    <profile>
      <id>oracle</id>
      <activation>
        <file>
          <exists>${basedir}/../ojdbc7.jar</exists>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.oracle</groupId>
          <artifactId>ojdbc7</artifactId>
          <version>12.1.0.2.0</version>
          <scope>system</scope>
          <systemPath>${basedir}/../ojdbc7.jar</systemPath>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>db2</id>
      <activation>
        <file>
          <exists>${basedir}/../db2jcc4.jar</exists>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.ibm.db2</groupId>
          <artifactId>db2jcc4</artifactId>
          <version>4.24.92</version>
          <scope>system</scope>
          <systemPath>${basedir}/../db2jcc4.jar</systemPath>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
  <build>
    <plugins>
      <plugin>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctor-maven-plugin</artifactId>
        <version>${maven-asciidoctor.version}</version>
        <executions>
          <execution>
            <id>generate-docs</id>
            <phase>package</phase>
            <goals>
              <goal>process-asciidoc</goal>
            </goals>
            <configuration>
              <sourceDocumentName>swagger2markup/index.adoc</sourceDocumentName>
              <outputDirectory>${project.build.directory}/rest-api-docs</outputDirectory>
              <backend>html</backend>
              <attributes>
                <toclevels>2</toclevels>
                <toc>left</toc>
                <doctype>book</doctype>
                <generated>src/main/asciidoc/swagger2markup</generated>
              </attributes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <shadedArtifactAttached>false</shadedArtifactAttached>
              <createDependencyReducedPom>false</createDependencyReducedPom>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <mainClass>io.nflow.tests.demo.DemoServer</mainClass>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>META-INF/spring.handlers</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>META-INF/spring.schemas</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>META-INF/cxf/bus-extensions.txt</resource>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
