<!--

    This file is part of the CRISTAL-iSE eXist-DB storage plugin.
    Copyright (c) 2001-2016 The CRISTAL Consortium. All rights reserved.

    This library is free software; you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as published
    by the Free Software Foundation; either version 3 of the License, or (at
    your option) any later version.

    This library is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
    License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this library; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

    http://www.fsf.org/licensing/licenses/lgpl.html

-->
<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>org.cristalise</groupId>
    <artifactId>cristalise</artifactId>
    <version>6.0.0</version>
  </parent>

  <artifactId>cristalise-testing</artifactId>

  <name>CRISTAL-iSE Integration Testing</name>
  <description>CRISTAL-iSE Testing Module</description>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <additionalparam>-Xdoclint:none</additionalparam>
    <maven.deploy.skip>false</maven.deploy.skip>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-eclipse-compiler</artifactId>
        <version>${groovy-eclipse-compiler.version}</version>
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerId>groovy-eclipse-compiler</compilerId>
          <release>${java.release}</release>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-compiler</artifactId>
            <version>${groovy-eclipse-compiler.version}</version>
          </dependency>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-batch</artifactId>
            <version>${groovy-eclipse-batch.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>com.bluetrainsoftware.maven</groupId>
        <artifactId>groovydoc-maven-plugin</artifactId>
        <version>2.1</version>
        <executions>
          <execution>
            <id>attach-docs</id>
            <phase>package</phase>
            <goals>
              <goal>attach-docs</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>com.google.cloud.tools</groupId>
        <artifactId>jib-maven-plugin</artifactId>
        <configuration>
          <from>
            <image>${docker-from-image}</image>
          </from>
          <to>
            <image>cristalise/testing:${project.parent.version}</image>
          </to>
          <container>
            <creationTime>${maven.build.timestamp}</creationTime>
            <environment>
              <APP_NAME>${project.artifactId}</APP_NAME>
            </environment>
            <jvmFlags>
              <jvmFlag>-DAPP_NAME=${project.artifactId}</jvmFlag>
              <jvmFlag>-Dlogback.configurationFile=/app/config/logback.xml</jvmFlag>
              <jvmFlag>-Dvertx.hazelcast.config=/app/config/cluster-config.xml</jvmFlag>
              <jvmFlag>-Xms1024m</jvmFlag>
              <jvmFlag>-Xdebug</jvmFlag>
            </jvmFlags>
            <mainClass>org.cristalise.kernel.process.StandardServer</mainClass>
            <args>
              <arg>-config</arg>
              <arg>/app/config/server.conf</arg>
              <arg>-connect</arg>
              <arg>/app/config/local.clc</arg>
              <arg>-Shiro.iniFile</arg>
              <arg>/app/config/shiro.ini</arg>
            </args>
            <ports>
              <port>7000</port>
            </ports>
            <volumes>
              <volume>/app/config</volume>
              <volume>/app/log</volume>
            </volumes>
          </container>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <!-- only required to force update transitive dependencies -->
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <!-- only required to force update transitive dependencies -->
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.cristalise</groupId>
      <artifactId>cristalise-jooqdb</artifactId>
      <version>${project.parent.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.cristalise</groupId>
      <artifactId>cristalise-gui</artifactId>
      <version>${project.parent.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.cristalise</groupId>
      <artifactId>cristalise-dev</artifactId>
      <version>${project.parent.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.cristalise</groupId>
      <artifactId>cristalise-dsl</artifactId>
      <version>${project.parent.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.cristalise</groupId>
      <artifactId>cristalise-xpath-outcomeinit</artifactId>
      <version>${project.parent.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.cristalise</groupId>
      <artifactId>cristalise-restapi</artifactId>
      <version>${project.parent.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.cristalise</groupId>
      <artifactId>cristalise-trigger</artifactId>
      <version>${project.parent.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.cristalise</groupId>
      <artifactId>cristalise-inmemory-lookup</artifactId>
      <version>${project.parent.version}</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.containers</groupId>
      <artifactId>jersey-container-grizzly2-http</artifactId>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.inject</groupId>
      <artifactId>jersey-hk2</artifactId>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
    </dependency>
    <dependency>
      <groupId>com.mysql</groupId>
      <artifactId>mysql-connector-j</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.janino</groupId>
      <artifactId>janino</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>net.javacrumbs.json-unit</groupId>
      <artifactId>json-unit</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-launcher</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility-groovy</artifactId>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.spockframework</groupId>
      <artifactId>spock-core</artifactId>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>*</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.groovy</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.spockframework</groupId>
      <artifactId>spock-unitils</artifactId>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>org.apache.groovy</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.unitils</groupId>
      <artifactId>unitils-core</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.mvel</groupId>
      <artifactId>mvel2</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
    </dependency>
    <dependency>
      <groupId>io.rest-assured</groupId>
      <artifactId>rest-assured</artifactId>
      <version>5.4.0</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>integtest</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>3.2.5</version>
              <configuration>
                <testSourceDirectory>${project.basedir}/src/main/groovy</testSourceDirectory>
                <testClassesDirectory>${project.build.directory}/classes/</testClassesDirectory>
                <redirectTestOutputToFile>true</redirectTestOutputToFile>
                <reuseForks>false</reuseForks>
                <includes>
                  <include>**/*Specs.*</include>
                  <include>**/*Spec.*</include>
                  <include>**/*Tests.*</include>
                  <include>**/*Test.*</include>
                  <include>**/*IT.*</include>
                </includes>
                <argLine>-Dvertx.hazelcast.config=src/main/config/cluster-config.xml -Dlogback.configurationFile=src/main/config/logback.xml</argLine>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
</project>
