<?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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.fcrepo</groupId>
    <artifactId>fcrepo-parent</artifactId>
    <version>4.7.0</version>
  </parent>

  <groupId>org.fcrepo.camel</groupId>
  <artifactId>fcrepo-camel</artifactId>
  <packaging>bundle</packaging>

  <version>4.5.0</version>

  <name>Fcrepo Camel Component</name>
  <description>Camel Component for interacting with a Fedora Repository</description>
  <url>http://fcrepo.org</url>

  <organization>
    <name>DuraSpace, Inc.</name>
    <url>http://www.duraspace.org/</url>
  </organization>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <project.copyrightYear>2015</project.copyrightYear>

    <!-- Use ${project_name} instead of ${project.artifactId} to avoid incorrect
      replacements of "fcrepo4" in child modules (for scm, site-distribution, etc -->
    <project_name>fcrepo-camel</project_name>

    <!-- https://github.com/github/maven-plugins/blob/master/README.md -->
    <github.global.server>github</github.global.server>

    <!-- dependencies -->
    <activemq.version>5.14.0</activemq.version>
    <camel.version>2.18.0</camel.version>
    <camel.version.range>[2.18,3)</camel.version.range>
    <commons.io.version>2.4</commons.io.version>
    <commons.lang3.version>3.4</commons.lang3.version>
    <httpclient.version>4.5.2</httpclient.version>
    <karaf.version>4.0.6</karaf.version>
    <jena.version>3.1.1</jena.version>
    <mockito.version>1.10.8</mockito.version>
    <pax-exam.version>4.8.0</pax-exam.version>
    <slf4j.version>1.7.20</slf4j.version>
    <spring.version>4.2.5.RELEASE</spring.version>
    <fcrepo.version>4.7.0</fcrepo.version>
    <fcrepo-java-client.version>0.2.1</fcrepo-java-client.version>

    <!-- osgi bundle transitive dependencies (for karaf provisioning) -->
    <commons.codec.version>1.10</commons.codec.version>
    <commons.csv.version>1.3</commons.csv.version>
    <jsonld.version>0.8.3</jsonld.version>
    <httpcore.version>4.4.3</httpcore.version>
    <thrift.version>0.9.2</thrift.version>
    <dexx-collection.version>0.6</dexx-collection.version>
    <!-- plugins -->
    <jetty.plugin.version>9.2.6.v20141205</jetty.plugin.version>
    <paxexam.plugin.version>1.2.4</paxexam.plugin.version>
    <!-- osgi bundle configuration -->
    <osgi.export.packages>org.fcrepo.camel.*;version=${project.version}</osgi.export.packages>
    <osgi.import.packages>*</osgi.import.packages>
  </properties>

  <scm>
    <connection>scm:git:git://github.com/fcrepo4-exts/${project_name}.git</connection>
    <developerConnection>scm:git:git@github.com:fcrepo4-exts/${project_name}.git</developerConnection>
    <url>https://github.com/fcrepo4-exts/fcrepo-camel</url>
    <tag>fcrepo-camel-4.5.0</tag>
  </scm>

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

  <dependencies>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core</artifactId>
      <version>${camel.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-jackson</artifactId>
      <version>${camel.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>${commons.lang3.version}</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-tx</artifactId>
      <version>${spring.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.jena</groupId>
      <artifactId>jena-osgi</artifactId>
      <version>${jena.version}</version>
      <exclusions>
        <!-- the jackson dependencies are pulled in by camel-jackson -->
        <exclusion>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient-osgi</artifactId>
      <version>${httpclient.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore-osgi</artifactId>
      <version>${httpcore.version}</version>
    </dependency>

    <dependency>
      <groupId>org.fcrepo.client</groupId>
      <artifactId>fcrepo-java-client</artifactId>
      <version>${fcrepo-java-client.version}</version>
    </dependency>

    <!-- logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>${commons.io.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.jena</groupId>
      <artifactId>jena-arq</artifactId>
      <version>${jena.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-test</artifactId>
      <version>${camel.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-http4</artifactId>
      <version>${camel.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-camel</artifactId>
      <version>${activemq.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-spring</artifactId>
      <version>${camel.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-test-karaf</artifactId>
      <version>${camel.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.ops4j.pax.exam</groupId>
      <artifactId>pax-exam-container-karaf</artifactId>
      <version>${pax-exam.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.ops4j.pax.exam</groupId>
      <artifactId>pax-exam-junit4</artifactId>
      <version>${pax-exam.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.karaf</groupId>
      <artifactId>apache-karaf</artifactId>
      <version>${karaf.version}</version>
      <type>zip</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.camel.karaf</groupId>
      <artifactId>apache-camel</artifactId>
      <version>${camel.version}</version>
      <type>xml</type>
      <classifier>features</classifier>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <defaultGoal>install</defaultGoal>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <configuration>
          <portNames>
            <portName>fcrepo.dynamic.test.port</portName>
            <portName>fcrepo.dynamic.jms.port</portName>
            <portName>fcrepo.dynamic.stomp.port</portName>
            <portName>jetty.dynamic.stop.port</portName>
            <portName>karaf.ssh.port</portName>
            <portName>karaf.rmiRegistry.port</portName>
            <portName>karaf.rmiServer.port</portName>
          </portNames>
        </configuration>
        <executions>
          <execution>
            <id>reserve-port</id>
            <phase>package</phase>
            <goals>
              <goal>reserve-network-port</goal>
            </goals>
          </execution>

          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>target/classes/features.xml</file>
                  <type>xml</type>
                  <classifier>features</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- pax exam -->
      <plugin>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>maven-paxexam-plugin</artifactId>
       <version>${paxexam.plugin.version}</version>
       <executions>
         <execution>
           <id>generate-config</id>
           <goals>
             <goal>generate-depends-file</goal>
           </goals>
         </execution>
       </executions>
     </plugin>

      <!-- integration testing -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <argLine>${jacoco.agent.it.arg}</argLine>
          <systemPropertyVariables>
            <fcrepo.dynamic.test.port>${fcrepo.dynamic.test.port}</fcrepo.dynamic.test.port>
            <fcrepo.dynamic.jms.port>${fcrepo.dynamic.jms.port}</fcrepo.dynamic.jms.port>
            <fcrepo.dynamic.stomp.port>${fcrepo.dynamic.stomp.port}</fcrepo.dynamic.stomp.port>
            <commons.codec.version>${commons.codec.version}</commons.codec.version>
            <commons.csv.version>${commons.csv.version}</commons.csv.version>
            <dexx.version>${dexx-collection.version}</dexx.version>
            <httpclient.version>${httpclient.version}</httpclient.version>
            <httpcore.version>${httpcore.version}</httpcore.version>
            <jsonld.version>${jsonld.version}</jsonld.version>
            <thrift.version>${thrift.version}</thrift.version>
            <karaf.ssh.port>${karaf.ssh.port}</karaf.ssh.port>
            <karaf.rmiRegistry.port>${karaf.rmiRegistry.port}</karaf.rmiRegistry.port>
            <karaf.rmiServer.port>${karaf.rmiServer.port}</karaf.rmiServer.port>
            <project.artifactId>${project.artifactId}</project.artifactId>
            <project.version>${project.version}</project.version>
          </systemPropertyVariables>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>

      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
      </plugin>

      <!-- verify that source files contain the correct license headers
        $ mvn license:check to check files
        $ mvn license:format to update files -->
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>com.github.github</groupId>
        <artifactId>site-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>

        <!-- Launch jetty for integration testing with fedora -->
        <plugin>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-maven-plugin</artifactId>
          <version>${jetty.plugin.version}</version>
          <configuration>
            <systemProperties>
              <force>true</force>
              <systemProperty>
                <name>fcrepo.home</name>
                <value>${project.build.directory}/fcrepo-data</value>
              </systemProperty>
              <systemProperty>
                <name>fcrepo.dynamic.jms.port</name>
                <value>${fcrepo.dynamic.jms.port}</value>
              </systemProperty>
              <systemProperty>
                <name>fcrepo.dynamic.stomp.port</name>
                <value>${fcrepo.dynamic.stomp.port}</value>
              </systemProperty>
              <systemProperty>
                <name>fcrepo.modeshape.configuration</name>
                <value>classpath:/config/file-simple/repository.json</value>
              </systemProperty>
              <systemProperty>
                <name>fcrepo.activemq.configuration</name>
                <value>file:${project.build.directory}/test-classes/config/test_activemq.xml</value>
              </systemProperty>
            </systemProperties>
            <scanIntervalSeconds>10</scanIntervalSeconds>
            <stopKey>STOP</stopKey>
            <stopPort>${jetty.dynamic.stop.port}</stopPort>
            <daemon>true</daemon>
          </configuration>
          <executions>
            <execution>
              <id>start-jetty</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>stop</goal>
                <goal>start</goal>
              </goals>
              <configuration>
                <httpConnector>
                  <port>${fcrepo.dynamic.test.port}</port>
                </httpConnector>
                <scanIntervalSeconds>0</scanIntervalSeconds>
                <daemon>true</daemon>
                <contextHandlers>
                    <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
                      <war>${project.build.directory}/fcrepo.war</war>
                      <contextPath>/fcrepo</contextPath>
                    </contextHandler>
                </contextHandlers>
              </configuration>
            </execution>

            <execution>
              <id>stop-jetty</id>
              <phase>post-integration-test</phase>
               <goals>
                 <goal>stop</goal>
               </goals>
             </execution>
          </executions>
        </plugin>

        <!--Bring in fcrepo webapp for integration testing-->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <executions>
            <execution>
              <id>copy</id>
              <phase>package</phase>
              <goals>
                <goal>copy</goal>
              </goals>
              <configuration>
                <artifactItems>
                  <artifactItem>
                    <groupId>org.fcrepo</groupId>
                    <artifactId>fcrepo-webapp</artifactId>
                    <version>${fcrepo.version}</version>
                    <type>war</type>
                    <outputDirectory>${project.build.directory}</outputDirectory>
                    <destFileName>fcrepo.war</destFileName>
                  </artifactItem>
                </artifactItems>
              </configuration>
            </execution>
          </executions>
        </plugin>




    </plugins>
  </build>

  <developers>
    <developer>
      <id>acoburn</id>
      <name>Aaron Coburn</name>
      <email>acoburn@amherst.edu</email>
      <organization>Amherst College</organization>
      <organizationUrl>http://www.amherst.edu</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
      <timezone>-5</timezone>
    </developer>

    <developer>
      <id>dlamb</id>
      <name>Danny Lamb</name>
      <email>dlamb@islandora.ca</email>
      <organization>Islandora Foundation</organization>
      <organizationUrl>http://islandora.ca</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
      <timezone>-4</timezone>
    </developer>

    <developer>
      <id>bseeger</id>
      <name>Bethany Seeger</name>
      <email>bseeger@amherst.edu</email>
      <organization>Amherst College</organization>
      <organizationUrl>http://www.amherst.edu</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
      <timezone>-5</timezone>
    </developer>
  </developers>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/fcrepo4-exts/fcrepo-camel/issues</url>
  </issueManagement>

  <ciManagement>
    <system>Jenkins</system>
    <url>http://jenkins.fcrepo.org/job/fcrepo-camel/</url>
  </ciManagement>
</project>
