<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">

  <parent>
    <groupId>org.opengis.cite</groupId>
    <artifactId>ets-common</artifactId>
    <version>4</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.opengis.cite</groupId>
  <artifactId>ets-cat30</artifactId>
  <version>1.4</version>
  <packaging>jar</packaging>

  <name>OGC Catalogue 3.0 Conformance Test Suite</name>
  <description>Checks a catalogue service implementation for conformance to
    "OGC Catalogue Services 3.0 Specification -- HTTP Protocol Binding" (OGC
    12-176r6) and related specifications.
  </description>
  <url>http://opengeospatial.github.io/ets-cat30/</url>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://opensource.org/licenses/Apache-2.0</url>
    </license>
  </licenses>

  <organization>
    <name>Open Geospatial Consortium</name>
    <url>http://www.opengeospatial.org/</url>
  </organization>
  <scm>
    <connection>scm:git:https://github.com/opengeospatial/ets-cat30.git</connection>
    <developerConnection>scm:git:git@github.com:opengeospatial/ets-cat30.git</developerConnection>
    <url>https://github.com/opengeospatial/ets-cat30</url>
    <tag>1.4</tag>
  </scm>
  <issueManagement>
    <system>GitHub Issue Tracker</system>
    <url>https://github.com/opengeospatial/ets-cat30/issues</url>
  </issueManagement>
  <developers>
    <developer>
      <name>R. Martell</name>
      <url>https://github.com/rjmartell</url>
      <timezone>Canada/Pacific</timezone>
    </developer>
  </developers>

  <properties>
    <ets-code>cat30</ets-code>
    <spec-version>3.0.0</spec-version>
    <teamengine.version>4.10</teamengine.version>
    <soapui.teamengine.endpoint>http://localhost:8081/teamengine</soapui.teamengine.endpoint>
    <soapui.iut>http://demo.pycsw.org/cite/csw?service=CSW&amp;version=3.0.0&amp;request=GetCapabilities</soapui.iut>
    <soapui.tests.passed>52</soapui.tests.passed>
    <soapui.tests.skipped>0</soapui.tests.skipped>
    <soapui.tests.failed>0</soapui.tests.failed>
    <soapui.test.fail.ignore>false</soapui.test.fail.ignore>
    <docker.teamengine.version>5.4.1</docker.teamengine.version>
  </properties>

  <pluginRepositories>
    <pluginRepository>
      <id>smartbear-sweden-plugin-repository</id>
      <url>http://www.soapui.org/repository/maven2/</url>
    </pluginRepository>
  </pluginRepositories>

  <dependencies>
    <dependency>
      <groupId>org.opengis.cite</groupId>
      <artifactId>geomatics-geotk</artifactId>
      <version>1.15</version>
    </dependency>
    <dependency>
      <groupId>org.opengis.cite.teamengine</groupId>
      <artifactId>teamengine-spi</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opengis.cite</groupId>
      <artifactId>schema-utils</artifactId>
      <version>1.8</version>
    </dependency>
    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-client</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>6.8.8</version>
    </dependency>
    <dependency>
      <groupId>org.geotoolkit</groupId>
      <artifactId>geotk-referencing</artifactId>
      <version>3.21</version>
    </dependency>
    <dependency>
      <groupId>org.opengis</groupId>
      <artifactId>geoapi-pending</artifactId>
      <version>3.1-M04</version>
    </dependency>
    <dependency>
      <groupId>org.opengis.cite.saxon</groupId>
      <artifactId>saxon9</artifactId>
      <version>9.0.0.8</version>
    </dependency>
    <dependency>
      <groupId>com.beust</groupId>
      <artifactId>jcommander</artifactId>
      <version>1.27</version>
    </dependency>
    <dependency>
      <groupId>org.geotoolkit</groupId>
      <artifactId>geotk-utility</artifactId>
      <version>3.21</version>
    </dependency>
    <dependency>
      <groupId>xml-apis</groupId>
      <artifactId>xml-apis</artifactId>
      <version>1.4.01</version>
    </dependency>
    <dependency>
      <groupId>xerces</groupId>
      <artifactId>xercesImpl</artifactId>
      <version>2.12.2</version>
    </dependency>
    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>jsr311-api</artifactId>
      <version>1.1.1</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.3</version>
        <configuration>
          <docfilessubdirs>true</docfilessubdirs>
          <show>package</show>
          <links>
            <link>http://testng.org/javadocs/</link>
          </links>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <archive>
            <manifest>
              <mainClass>org.opengis.cite.cat30.TestNGController</mainClass>
            </manifest>
          </archive>
          <descriptors>
            <descriptor>${basedir}/src/assembly/deps.xml</descriptor>
            <descriptor>${basedir}/src/assembly/ctl-scripts.xml</descriptor>
            <descriptor>${basedir}/src/assembly/aio.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <tagNameFormat>@{project.version}</tagNameFormat>
          <releaseProfiles>release</releaseProfiles>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-publish-plugin</artifactId>
        <version>1.1</version>
        <configuration>
          <scmBranch>gh-pages</scmBranch>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.smartbear.soapui</groupId>
          <artifactId>soapui-maven-plugin</artifactId>
          <version>5.5.0</version>
          <dependencies>
            <dependency>
              <groupId>com.jgoodies</groupId>
              <artifactId>forms</artifactId>
              <version>1.0.7</version>
            </dependency>
          </dependencies>
          <configuration>
            <projectFile>src/test/resources/soapui/ets-cat30-soapui-project.xml</projectFile>
            <settingsFile>src/test/resources/soapui/ets-cat30-soapui-settings.xml</settingsFile>
            <outputFolder>${project.build.directory}/soapui</outputFolder>
            <junitReport>true</junitReport>
            <testFailIgnore>${soapui.test.fail.ignore}</testFailIgnore>
            <projectProperties>
              <value>teamengine.endpoint=${soapui.teamengine.endpoint}</value>
              <value>iut=${soapui.iut}</value>
              <value>tests.passed=${soapui.tests.passed}</value>
              <value>tests.skipped=${soapui.tests.skipped}</value>
              <value>tests.failed=${soapui.tests.failed}</value>
            </projectProperties>
          </configuration>
        </plugin>
        <plugin>
          <groupId>io.fabric8</groupId>
          <artifactId>docker-maven-plugin</artifactId>
          <version>0.28.0</version>
          <configuration>
            <images>
              <image>
                <name>ogccite/${project.artifactId}</name>
                <build>
                  <dockerFileDir>${project.basedir}/src/docker</dockerFileDir>
                  <tags>
                    <tag>${project.version}-teamengine-${docker.teamengine.version}</tag>
                  </tags>
                  <assembly>
                    <inline>
                      <fileSets>
                        <fileSet>
                          <directory>${project.build.directory}</directory>
                          <outputDirectory>.</outputDirectory>
                          <includes>
                            <include>dependency/*teamengine-*.war</include>
                            <include>dependency/*teamengine-*.zip</include>
                            <include>*ets-*.zip</include>
                          </includes>
                        </fileSet>
                      </fileSets>
                    </inline>
                  </assembly>
                </build>
                <run>
                  <ports>
                    <port>8081:8080</port>
                  </ports>
                  <wait>
                    <http>
                      <url>http://localhost:8081/teamengine</url>
                    </http>
                    <time>120000</time>
                  </wait>
                </run>
              </image>
            </images>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.0.0</version>
          <configuration>
            <artifactItems>
              <artifactItem>
                <groupId>org.opengis.cite.teamengine</groupId>
                <artifactId>teamengine-web</artifactId>
                <version>${docker.teamengine.version}</version>
                <type>war</type>
              </artifactItem>
              <artifactItem>
                <groupId>org.opengis.cite.teamengine</groupId>
                <artifactId>teamengine-web</artifactId>
                <version>${docker.teamengine.version}</version>
                <classifier>common-libs</classifier>
                <type>zip</type>
              </artifactItem>
              <artifactItem>
                <groupId>org.opengis.cite.teamengine</groupId>
                <artifactId>teamengine-console</artifactId>
                <version>${docker.teamengine.version}</version>
                <classifier>base</classifier>
                <type>zip</type>
              </artifactItem>
            </artifactItems>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <!-- Enable if GPG 2.1+ is used -->
                  <!--<gpgArguments>
                    <arg>&#45;&#45;pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>-->
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>docker</id>
      <build>
        <plugins>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>build</id>
                <goals>
                  <goal>build</goal>
                </goals>
              </execution>
              <execution>
                <id>push</id>
                <goals>
                  <goal>push</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>copy</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>integration-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-maven-plugin</artifactId>
            <executions>
              <execution>
                <phase>integration-test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>start</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>build</goal>
                  <goal>start</goal>
                </goals>
              </execution>
              <execution>
                <id>stop</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop</goal>
                  <goal>remove</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>copy</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  
  <repositories>
    <!-- Geotk 3.21 not available in Central repository -->
    <repository>
      <id>geotoolkit</id>
      <name>Geotk Modules</name>
      <url>http://maven.geotoolkit.org/</url>
      <layout>default</layout>
    </repository>
  </repositories>

  <distributionManagement>
    <repository>
      <id>sonatype-nexus-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <site>
      <id>site</id>
      <url>scm:git:git@github.com:opengeospatial/ets-cat30.git</url>
    </site>
  </distributionManagement>
</project>
