<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<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.apache.activemq</groupId>
    <artifactId>activemq-parent</artifactId>
    <version>5.7.0</version>
  </parent>

  <artifactId>activemq-leveldb</artifactId>
  <packaging>jar</packaging>

  <name>ActiveMQ :: LevelDB</name>
  <description>ActiveMQ LevelDB based store</description>

  <dependencies>

    <!-- for scala support -->
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>${scala-version}</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-core</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.fusesource.hawtbuf</groupId>
      <artifactId>hawtbuf-proto</artifactId>
      <version>${hawtbuf-version}</version>
    </dependency>

    <dependency>
      <groupId>org.fusesource.hawtdispatch</groupId>
      <artifactId>hawtdispatch-scala</artifactId>
      <version>${hawtdispatch-version}</version>
    </dependency>

    <dependency>
      <groupId>org.iq80.leveldb</groupId>
      <artifactId>leveldb</artifactId>
      <version>0.2</version>
    </dependency>

    <dependency>
      <groupId>org.fusesource.leveldbjni</groupId>
      <artifactId>leveldbjni-osx</artifactId>
      <version>${leveldbjni-version}</version>
    </dependency>
    <dependency>
      <groupId>org.fusesource.leveldbjni</groupId>
      <artifactId>leveldbjni-linux32</artifactId>
      <version>${leveldbjni-version}</version>
    </dependency>
    <dependency>
      <groupId>org.fusesource.leveldbjni</groupId>
      <artifactId>leveldbjni-linux64</artifactId>
      <version>${leveldbjni-version}</version>
    </dependency>
    <dependency>
      <groupId>org.fusesource.leveldbjni</groupId>
      <artifactId>leveldbjni-win32</artifactId>
      <version>${leveldbjni-version}</version>
    </dependency>
    <dependency>
      <groupId>org.fusesource.leveldbjni</groupId>
      <artifactId>leveldbjni-win64</artifactId>
      <version>${leveldbjni-version}</version>
    </dependency>

    <!-- For Optional Snappy Compression -->
    <dependency>
      <groupId>org.xerial.snappy</groupId>
      <artifactId>snappy-java</artifactId>
      <version>1.0.3</version>
    </dependency>

    <dependency>
      <groupId>org.iq80.snappy</groupId>
      <artifactId>snappy</artifactId>
      <version>0.2</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-core-asl</artifactId>
      <version>${jackson-version}</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-mapper-asl</artifactId>
      <version>${jackson-version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-core</artifactId>
      <version>${hadoop-version}</version>
      <exclusions>
        <!-- hadoop's transative dependencies are such a pig -->
        <exclusion>
          <groupId>commons-cli</groupId>
          <artifactId>commons-cli</artifactId>
        </exclusion>
        <exclusion>
          <groupId>xmlenc</groupId>
          <artifactId>xmlenc</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-math</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-net</groupId>
          <artifactId>commons-net</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-httpclient</groupId>
          <artifactId>commons-httpclient</artifactId>
        </exclusion>
        <exclusion>
          <groupId>tomcat</groupId>
          <artifactId>jasper-runtime</artifactId>
        </exclusion>
        <exclusion>
          <groupId>tomcat</groupId>
          <artifactId>jasper-compiler</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-el</groupId>
          <artifactId>commons-el</artifactId>
        </exclusion>
        <exclusion>
          <groupId>net.java.dev.jets3t</groupId>
          <artifactId>jets3t</artifactId>
        </exclusion>
        <exclusion>
          <groupId>net.sf.kosmosfs</groupId>
          <artifactId>kfs</artifactId>
        </exclusion>
        <exclusion>
          <groupId>hsqldb</groupId>
          <artifactId>hsqldb</artifactId>
        </exclusion>
        <exclusion>
          <groupId>oro</groupId>
          <artifactId>oro</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.eclipse.jdt</groupId>
          <artifactId>core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Testing Dependencies -->
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-core</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-console</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Hadoop Testing Deps -->
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-test</artifactId>
      <version>${hadoop-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty</artifactId>
      <version>6.1.26</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty-util</artifactId>
      <version>6.1.26</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>tomcat</groupId>
      <artifactId>jasper-runtime</artifactId>
      <version>5.5.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>tomcat</groupId>
      <artifactId>jasper-compiler</artifactId>
      <version>5.5.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jsp-api-2.1</artifactId>
      <version>6.1.14</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jsp-2.1</artifactId>
      <version>6.1.14</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-math</artifactId>
      <version>2.2</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.scalatest</groupId>
      <artifactId>scalatest_2.9.1</artifactId>
      <version>${scalatest-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>

    <plugins>
      <plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
        <version>${scala-plugin-version}</version>
        <executions>
          <execution>
            <id>compile</id>
            <goals><goal>compile</goal> </goals>
            <phase>compile</phase>
          </execution>
          <execution>
            <id>test-compile</id>
            <goals>
            <goal>testCompile</goal>
            </goals>
            <phase>test-compile</phase>
          </execution>
          <execution>
            <phase>process-resources</phase>
            <goals>
            <goal>compile</goal>
            </goals>
          </execution>
        </executions>

        <configuration>
          <jvmArgs>
            <jvmArg>-Xmx1024m</jvmArg>
            <jvmArg>-Xss8m</jvmArg>
          </jvmArgs>
          <scalaVersion>${scala-version}</scalaVersion>
          <args>
            <arg>-deprecation</arg>
          </args>
          <compilerPlugins>
            <compilerPlugin>
              <groupId>org.fusesource.jvmassert</groupId>
              <artifactId>jvmassert</artifactId>
              <version>1.1</version>
            </compilerPlugin>
          </compilerPlugins>
        </configuration>
      </plugin>

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

        <configuration>
          <!-- we must turn off the use of system class loader so our tests can find stuff - otherwise ScalaSupport compiler can't find stuff -->
          <useSystemClassLoader>false</useSystemClassLoader>
          <!--forkMode>pertest</forkMode-->
          <childDelegation>false</childDelegation>
          <useFile>true</useFile>
          <failIfNoTests>false</failIfNoTests>
          <excludes>
            <exclude>**/EnqueueRateScenariosTest.*</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.fusesource.hawtbuf</groupId>
        <artifactId>hawtbuf-protoc</artifactId>
        <version>${hawtbuf-version}</version>
        <configuration>
          <type>alt</type>
        </configuration>
         <executions>
          <execution>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.fusesource.mvnplugins</groupId>
        <artifactId>maven-uberize-plugin</artifactId>
        <version>1.14</version>
        <executions>
          <execution>
            <id>all</id>
            <phase>package</phase>
            <goals><goal>uberize</goal></goals>
          </execution>
        </executions>
        <configuration>
          <uberArtifactAttached>true</uberArtifactAttached>
          <uberClassifierName>uber</uberClassifierName>
          <artifactSet>
            <includes>
              <include>org.scala-lang:scala-library</include>
              <include>org.fusesource.hawtdispatch:hawtdispatch</include>
              <include>org.fusesource.hawtdispatch:hawtdispatch-scala</include>
              <include>org.fusesource.hawtbuf:hawtbuf</include>
              <include>org.fusesource.hawtbuf:hawtbuf-proto</include>

              <include>org.iq80.leveldb:leveldb-api</include>

              <!--
              <include>org.iq80.leveldb:leveldb</include>
              <include>org.xerial.snappy:snappy-java</include>
              <include>com.google.guava:guava</include>
              -->
              <include>org.xerial.snappy:snappy-java</include>

              <include>org.fusesource.leveldbjni:leveldbjni</include>
              <include>org.fusesource.leveldbjni:leveldbjni-osx</include>
              <include>org.fusesource.leveldbjni:leveldbjni-linux32</include>
              <include>org.fusesource.leveldbjni:leveldbjni-linux64</include>
              <include>org.fusesource.hawtjni:hawtjni-runtime</include>

              <!-- include bits need to access hdfs as a client -->
              <include>org.apache.hadoop:hadoop-core</include>
              <include>commons-configuration:commons-configuration</include>
              <include>org.codehaus.jackson:jackson-mapper-asl</include>
              <include>org.codehaus.jackson:jackson-core-asl</include>

            </includes>
          </artifactSet>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <configuration>
          <classifier>bundle</classifier>
          <excludeDependencies />
          <instructions>
            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
            <Fragment-Host>org.apache.activemq.activemq-core</Fragment-Host>
            <Export-Package>
                org.apache.activemq.leveldb*;version=${project.version};-noimport:=;-split-package:=merge-last,
            </Export-Package>
            <Embed-Dependency>*;inline=**;artifactId=
              hawtjni-runtime|hawtbuf|hawtbuf-proto|hawtdispatch|hawtdispatch-scala|scala-library|
              leveldb-api|leveldbjni|leveldbjni-osx|leveldbjni-linux32|leveldbjni-linux64|
              hadoop-core|commons-configuration|jackson-mapper-asl|jackson-core-asl|commons-lang</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>
            <Import-Package>*;resolution:=optional</Import-Package>
          </instructions>
        </configuration>
        <executions>
          <execution>
            <id>bundle</id>
            <phase>package</phase>
            <goals>
              <goal>bundle</goal>
            </goals>
          </execution>
        </executions>
        </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings only.
            It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>
                      org.fusesource.hawtbuf
                    </groupId>
                    <artifactId>
                      hawtbuf-protoc
                    </artifactId>
                    <versionRange>[1.9,)</versionRange>
                    <goals>
                      <goal>compile</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
              </pluginExecution>
              <pluginExecution>
                <pluginExecutionFilter>
                    <groupId>org.scala-tools</groupId>
                    <artifactId>
                      maven-scala-plugin
                    </artifactId>
                    <versionRange>
                      [2.15.1,)
                    </versionRange>
                    <goals>
                      <goal>compile</goal>
                      <goal>testCompile</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

</project>
