<?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>
  <artifactId>ets-wcs20</artifactId>
  <groupId>org.opengis.cite</groupId>
  <version>1.20</version>

  <name>OGC Web Coverage Service 2.0.1 - Executable Test Suite</name>
  <description>
  Verifies conformance of implementations to OGC Web Coverage Service 2.0.1.
  </description>
  <url>https://github.com/opengeospatial/ets-wcs20</url>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://opensource.org/licenses/Apache-2.0</url>
    </license>
  </licenses>

  <organization>
    <name>Open Geospatial Consortium</name>
    <url>http://www.opengeospatial.org</url>
  </organization>
  <scm>
    <url>https://github.com/opengeospatial/ets-wcs20</url>    
    <connection>scm:git:https://github.com/opengeospatial/ets-wcs20.git</connection>    
    <developerConnection>scm:git:git@github.com:opengeospatial/ets-wcs20.git</developerConnection>
    <tag>1.20</tag>
  </scm>
  <issueManagement>
    <system>GitHub Issue Tracker</system>
    <url>https://github.com/opengeospatial/ets-wcs20/issues</url>
  </issueManagement>
  <developers>
    <developer>
      <name>Coim</name>
      <url>https://github.com/coim32</url>
    </developer>
    <developer>
      <name>L. Bermudez</name>
      <url>https://github.com/bermud</url>
    </developer>
    <developer>
      <name>D. Stenger</name>
      <url>https://github.com/dstenger</url>
    </developer>
    <developer>
      <name>L. Goltz</name>
      <url>https://github.com/lgoltz</url>
    </developer>
    <developer>
      <name>K. Nangare</name>
      <url>https://github.com/keshav-nangare</url>
    </developer>
  </developers>

  <properties>
    <ets-code>wcs</ets-code>
    <spec-version>2.0.1</spec-version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <teamengine.version>5.6.1</teamengine.version>
    <docker.teamengine.version>5.6.1</docker.teamengine.version>
    <soapui.teamengine.endpoint>http://localhost:8081/teamengine</soapui.teamengine.endpoint>
    <soapui.teamengine.user>ogctest</soapui.teamengine.user>
    <soapui.teamengine.password>ogctest</soapui.teamengine.password>
    <soapui.iut>http://conformance.rasdaman.com/rasdaman/ows?service=WCS&amp;version=2.0.1&amp;request=GetCapabilities</soapui.iut>
    <soapui.tests.passed>126</soapui.tests.passed>
    <soapui.tests.skipped>0</soapui.tests.skipped>
    <soapui.tests.failed>1</soapui.tests.failed>
    <soapui.test.fail.ignore>false</soapui.test.fail.ignore>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.opengis.cite.teamengine</groupId>
      <artifactId>teamengine-spi-ctl</artifactId>
      <version>${teamengine.version}</version>
    </dependency>
    <dependency>
      <groupId>org.locationtech.jts</groupId>
      <artifactId>jts-core</artifactId>
      <version>1.18.1</version>
    </dependency>
    <dependency>
      <groupId>org.locationtech.proj4j</groupId>
      <artifactId>proj4j</artifactId>
      <version>1.1.3</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

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

  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.9</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>license</report>
              <report>issue-tracking</report>
              <report>scm</report>
            </reports>
          </reportSet>
        </reportSets>
        <configuration>
          <linkOnly>true</linkOnly>
        </configuration>
      </plugin>  
    </plugins>
  </reporting> 

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.0</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <debug>false</debug>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <Build-Host>${hostname}</Build-Host>
              <Build-Time>${maven.build.timestamp}</Build-Time>
              <Build-Revision>${buildNumber}</Build-Revision>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>1.4</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>create</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doCheck>false</doCheck>
          <doUpdate>false</doUpdate>
          <shortRevisionLength>10</shortRevisionLength>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.18</version>
        <configuration>
          <skipTests>true</skipTests>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <archive>
            <manifest>
              <mainClass>org.opengis.cite.wcs20.CtlController</mainClass>
            </manifest>
          </archive>
          <descriptors>
            <descriptor>${basedir}/src/assembly/ctl.xml</descriptor>
            <descriptor>${basedir}/src/assembly/aio.xml</descriptor>
            <descriptor>${basedir}/src/assembly/deps.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </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.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.4</version>
        <configuration>
          <relativizeDecorationLinks>false</relativizeDecorationLinks>
          <skipDeploy>true</skipDeploy>
        </configuration>
        <executions>
          <execution>
            <id>site-package</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.doxia</groupId>
            <artifactId>doxia-module-markdown</artifactId>
            <version>1.6</version>
          </dependency>
        </dependencies>
      </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>
      <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-wcs20-soapui-project.xml</projectFile>
          <settingsFile>src/test/resources/soapui/ets-wcs20-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>teamengine.user=${soapui.teamengine.user}</value>
            <value>teamengine.password=${soapui.teamengine.password}</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>
    </plugins>

    <pluginManagement>
      <plugins>
         <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>

    <resources>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>${basedir}/src/main/scripts</directory>
        <targetPath>${ets-code}/${spec-version}</targetPath>
      </resource>
      <resource>
        <directory>src/main/javadoc</directory>
        <filtering>true</filtering>
        <targetPath>doc/${ets-code}/${project.version}</targetPath>
      </resource>
    </resources>

  </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>
                  <gpgArguments>
                    <arg>--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>

  <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-wcs20.git</url>
    </site>
  </distributionManagement>
</project>
