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

  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.4.RELEASE</version>
    <relativePath />
  </parent>

  <groupId>org.kgrid</groupId>
  <artifactId>shelf-api</artifactId>
  <version>2.1.1</version>

  <name>kgrid-shelf-api</name>
  <description>KGrid Shelf API</description>
  <url>https://github.com/kgrid</url>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>KGrid Developer</name>
      <email>kgrid-developers@umich.edu</email>
      <organization>KGrid</organization>
      <organizationUrl>http://kgrig.org</organizationUrl>
    </developer>
  </developers>

  <scm>

    <url>https://github.com/kgrid/kgrid-shelf</url>
    <connection>scm:git:https://github.com/kgrid/kgrid-shelf.git</connection>
    <developerConnection>scm:git:https://github.com/kgrid/kgrid-shelf.git</developerConnection>
    <tag>shelf-api-2.1.1</tag>
  </scm>
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <exclusions>
        <exclusion>
          <groupId>com.vaadin.external.google</groupId>
          <artifactId>android-json</artifactId>
        </exclusion>
      </exclusions>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-actuator</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.jena</groupId>
      <artifactId>apache-jena-libs</artifactId>
      <version>3.9.0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.github.jsonld-java</groupId>
      <artifactId>jsonld-java</artifactId>
      <version>0.12.2</version>
    </dependency>
    <dependency>
      <groupId>org.zeroturnaround</groupId>
      <artifactId>zt-zip</artifactId>
      <version>1.13</version>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-yaml</artifactId>
      <version>2.9.6</version>
    </dependency>
    <dependency>
      <groupId>nl.jqno.equalsverifier</groupId>
      <artifactId>equalsverifier</artifactId>
      <version>3.0.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.jena</groupId>
      <artifactId>jena-querybuilder</artifactId>
      <version>3.2.0</version>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.jayway.jsonpath</groupId>
      <artifactId>json-path</artifactId>
      <version>2.2.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.json</groupId>
      <artifactId>json</artifactId>
      <version>20180813</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-swagger2</artifactId>
      <version>2.9.2</version>
    </dependency>
<!--    byte-buddy version upgrade to handle Java 10+. -->
<!-- Consider removing on spring-boot version change -->
    <dependency>
      <groupId>net.bytebuddy</groupId>
      <artifactId>byte-buddy</artifactId>
      <version>1.10.6</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.18.1</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-junit47</artifactId>
            <version>2.12</version>
          </dependency>
        </dependencies>
        <configuration>
          <includes>
            <include>**/*.class</include>
          </includes>
          <excludedGroups>org.kgrid.shelf.repository.FedoraIntegrationTest, org.kgrid.shelf.repository.FedoraFusekiTest</excludedGroups>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-source</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>add-integration-test-sources</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/integration-test/java</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-integration-test-resources</id>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>add-test-resource</goal>
            </goals>
            <configuration>
              <resources>
                <resource>
                  <filtering>true</filtering>
                  <directory>src/integration-test/resources</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
          </plugins>
  </build>

  <profiles>
    <profile>
    <id>fcrepo_it</id>
    <build>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-failsafe-plugin</artifactId>
         <version>2.22.0</version>
         <executions>
           <execution>
             <goals>
               <goal>integration-test</goal>
             </goals>
             <configuration>
               <includes>
                 <include>**/*.class</include>
               </includes>
             </configuration>
           </execution>
         </executions>
         <configuration>
           <groups>org.kgrid.shelf.repository.FedoraIntegrationTest</groups>
         </configuration>
       </plugin>
       <plugin>
         <groupId>io.fabric8</groupId>
         <artifactId>docker-maven-plugin</artifactId>
         <version>0.26.0</version>
         <configuration>
           <images>
             <image>
               <name>kgrid/fcrepo:4.7.5</name>
               <alias>fcrepo_test</alias>
               <run>
                 <ports>
                   <port>8080:8080</port>
                 </ports>
                 <namingStrategy>alias</namingStrategy>
                 <wait>
                   <http>
                     <url>http://localhost:8080/fcrepo/rest/</url>
                     <method>GET</method>
                     <status>200</status>
                   </http>
                   <time>1000000</time>
                   <kill>10000</kill>
                   <shutdown>5000</shutdown>
                 </wait>
               </run>
             </image>
           </images>
         </configuration>
         <executions>
           <execution>
             <id>start</id>
             <phase>pre-integration-test</phase>
             <goals>
               <goal>start</goal>
             </goals>
           </execution>
           <execution>
             <id>stop</id>
             <phase>post-integration-test</phase>
             <goals>
               <goal>stop</goal>
             </goals>
           </execution>
         </executions>
       </plugin>
     </plugins>
    </build>
    </profile>
    <profile>
      <id>fcrepo_fuseki</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.22.0</version>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                </goals>
                <configuration>
                  <includes>
                    <include>**/*.class</include>
                  </includes>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <groups>org.kgrid.shelf.repository.FedoraFusekiTest</groups>
            </configuration>
          </plugin>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <version>0.26.0</version>
            <configuration>
              <images>
                <image>
                  <name>yinlinchen/fcrepo4-docker:4.7.5</name>
                  <alias>fcrepo_fuseki_test</alias>
                  <run>
                    <ports>
                      <port>8080:8080</port>
                    </ports>
                    <namingStrategy>alias</namingStrategy>
                    <wait>
                      <http>
                        <url>http://localhost:8080/fcrepo/rest/</url>
                        <method>GET</method>
                        <status>200</status>
                      </http>
                      <time>1000000</time>
                      <kill>10000</kill>
                      <shutdown>5000</shutdown>
                    </wait>
                  </run>
                </image>
              </images>
            </configuration>
            <executions>
              <execution>
                <id>start</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>start</goal>
                </goals>
              </execution>
              <execution>
                <id>stop</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ci</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <configuration>
              <gpgArguments>
                <gpgArgument>--pinentry-mode=loopback</gpgArgument>
              </gpgArguments>
            </configuration>
            <executions>
              <execution>
                <id>sign-artifact</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
              <goals>deploy</goals>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
