<?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.fcrepo</groupId>
    <artifactId>fcrepo</artifactId>
    <version>4.3.0</version>
  </parent>

  <artifactId>fcrepo4-client</artifactId>
  <name>${project.artifactId}</name>
  <description>Fedora Commons 4 Java Client</description>
  <packaging>pom</packaging>

  <repositories>
    <repository>
      <id>snapshots-repo</id>
      <url>http://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <properties>
    <project_name>fcrepo4-client</project_name>
    <httpcomponents.version>4.3.2</httpcomponents.version>
    <httpclient.version>4.3.3</httpclient.version>
    <logback.version>1.0.13</logback.version>
    <slf4j.version>1.7.7</slf4j.version>
    <checkstyle.plugin.version>2.12.1</checkstyle.plugin.version>
  </properties>

  <modules>
    <module>fcrepo-client</module>
    <module>fcrepo-client-impl</module>
  </modules>

  <scm>
    <connection>scm:git:git://github.com/fcrepo4-labs/${project_name}.git</connection>
    <developerConnection>scm:git:git@github.com:fcrepo4-labs/${project_name}.git</developerConnection>
    <url>https://github.com/fcrepo4-labs/${project_name}</url>
    <tag>fcrepo4-client-4.3.0</tag>
  </scm>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.fcrepo</groupId>
        <artifactId>fcrepo4-bom</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
        <scope>runtime</scope>
      </dependency>
      <!-- test gear -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>${httpcomponents.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>${httpclient.version}</version>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>1.9.5</version>
        <scope>test</scope>
        <exclusions>
          <!-- mockito-core depends on hamcrest-core-1.0, but junit pulls 
            in the more recent 1.3 -->
          <exclusion>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.github.github</groupId>
          <artifactId>site-maven-plugin</artifactId>
          <version>0.11</version>
          <configuration>
            <message>Creating site for ${project.artifactId},
              ${project.version}</message>
            <!-- this does the trick to place every module in the correct
              subfolder -->
            <path>${project.distributionManagement.site.url}</path>
            <merge>true</merge>
          </configuration>
          <executions>
            <execution>
              <id>github</id>
              <goals>
                <goal>site</goal>
              </goals>
              <phase>site-deploy</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.4</version>
          <configuration>
            <skipDeploy>true</skipDeploy>
          </configuration>
          <dependencies>
            <dependency>
              <!-- allows markdown syntax for site generation. To use it
                place files below src/site/markdown/[filename].md -->
              <groupId>org.apache.maven.doxia</groupId>
              <artifactId>doxia-module-markdown</artifactId>
              <version>1.3</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${checkstyle.plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>org.fcrepo</groupId>
              <artifactId>fcrepo-build-tools</artifactId>
              <version>${project.version}</version>
            </dependency>
          </dependencies>
          <configuration>
            <includeTestSourceDirectory>true</includeTestSourceDirectory>
            <consoleOutput>true</consoleOutput>
            <logViolationsToConsole>true</logViolationsToConsole>
            <failsOnError>true</failsOnError>
            <failOnViolation>true</failOnViolation>
            <violationSeverity>warning</violationSeverity>
            <configLocation>fcrepo-checkstyle/checkstyle.xml</configLocation>
            <suppressionsLocation>fcrepo-checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
          </configuration>
          <executions>
            <execution>
              <id>checkstyle</id>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.18.1</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.cargo</groupId>
          <artifactId>cargo-maven2-plugin</artifactId>
          <version>1.4.12</version>
          <configuration>
            <configuration>
              <properties>
                <cargo.servlet.port>${fcrepo.dynamic.test.port}</cargo.servlet.port>
              </properties>
            </configuration>
            <deployables>
              <deployable>
                <groupId>org.fcrepo</groupId>
                <artifactId>fcrepo-webapp</artifactId>
                <type>war</type>
              </deployable>
            </deployables>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>com.github.github</groupId>
        <artifactId>site-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>reserve-network-port</id>
            <goals>
              <goal>reserve-network-port</goal>
            </goals>
            <phase>process-test-resources</phase>
            <configuration>
              <portNames>
                <!-- reserve ports for integration tests -->
                <portName>fcrepo.dynamic.jms.port</portName>
                <portName>fcrepo.dynamic.test.port</portName>
                <portName>fcrepo.dynamic.stomp.port</portName>
              </portNames>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <!-- export ports for integration tests to system.env-->
          <systemPropertyVariables>
            <fcrepo.dynamic.jms.port>${fcrepo.dynamic.jms.port}</fcrepo.dynamic.jms.port>
            <fcrepo.dynamic.test.port>${fcrepo.dynamic.test.port}</fcrepo.dynamic.test.port>
            <fcrepo.dynamic.stomp.port>${fcrepo.dynamic.stomp.port}</fcrepo.dynamic.stomp.port>
            <integration-test>true</integration-test>
          </systemPropertyVariables>
        </configuration>
        <executions>
          <execution>
            <id>perform-it</id>
            <goals>
              <goal>integration-test</goal>
            </goals>
          </execution>
          <execution>
            <id>verify-it</id>
            <goals>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <comments>Copyright (c) 2014 DuraSpace</comments>
    </license>
  </licenses>
  <distributionManagement>
    <site>
      <id>gh-pages</id>
      <name>Deployment through GitHub's site deployment plugin</name>
      <url>site/${project.version}</url>
    </site>
  </distributionManagement>
  <profiles>
    <profile>
      <id>jetty7x</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven2-plugin</artifactId>
              <configuration>
                <container>
                  <containerId>jetty7x</containerId>
                  <artifactInstaller>
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-distribution</artifactId>
                    <version>7.6.15.v20140411</version>
                  </artifactInstaller>
                  <systemProperties>
                    <fcrepo.dynamic.jms.port>${fcrepo.dynamic.jms.port}</fcrepo.dynamic.jms.port>
                    <fcrepo.dynamic.stomp.port>${fcrepo.dynamic.stomp.port}</fcrepo.dynamic.stomp.port>
                  </systemProperties>
                </container>
              </configuration>
              <dependencies>
                <dependency>
                  <groupId>commons-logging</groupId>
                  <artifactId>commons-logging</artifactId>
                  <version>1.2</version>
                </dependency>
              </dependencies>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
</project>
