<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>
    <groupId>com.amazonaws</groupId>
    <artifactId>dynamodb-titan054-storage-backend</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>
    <name>Amazon DynamoDB Storage Backend for Titan</name>
    <url>https://github.com/awslabs/dynamodb-titan-storage-backend</url>
    <description>The Amazon DynamoDB Storage Backend for Titan: Distributed Graph Database allows Titan graphs to use DynamoDB as a storage backend.</description>
    <scm>
        <url>git@github.com:awslabs/dynamodb-titan-storage-backend.git</url>
        <tag>titan0.5.4-1.0.0</tag>
    </scm>
    <properties>
        <test.extra.jvm.opts>-javaagent:${basedir}/target/jamm-${jamm.version}.jar </test.extra.jvm.opts>
        <default.test.jvm.opts>-Xms256m -Xmx1280m -XX:+HeapDumpOnOutOfMemoryError -ea ${test.extra.jvm.opts} </default.test.jvm.opts>
        <mem.jvm.opts>-Xms256m -Xmx768m -ea -XX:+HeapDumpOnOutOfMemoryError ${test.extra.jvm.opts} </mem.jvm.opts>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <dynamodb-local.port>4567</dynamodb-local.port>
        <dynamodb-local.endpoint>http://localhost:${dynamodb-local.port}</dynamodb-local.endpoint>
        <jdk.version>1.7</jdk.version>
        <aws.java.sdk.version>[1.10, 2.0.0)</aws.java.sdk.version>
        <titan.version>0.5.4</titan.version>
        <tinkerpop.version>2.5.0</tinkerpop.version>
        <dependency.plugin.version>2.10</dependency.plugin.version>
        <maven.assembly.plugin.version>2.5.5</maven.assembly.plugin.version>
        <maven.compiler.plugin.version>3.3</maven.compiler.plugin.version>
        <maven.surefire.version>2.18.1</maven.surefire.version>
        <maven.resources.plugin.version>2.7</maven.resources.plugin.version>
        <exec.maven.plugin.version>1.2</exec.maven.plugin.version>
        <slf4j.version>1.7.5</slf4j.version>
        <jackson2.version>2.2.3</jackson2.version>
        <opencsv.version>2.4</opencsv.version>
        <metrics3.version>3.0.1</metrics3.version>
        <commons.logging.version>1.1.1</commons.logging.version>
        <sqlite4java.version>1.0.392</sqlite4java.version>
        <hamcrest.version>1.3</hamcrest.version>
        <hadoop.version>2.2.0</hadoop.version>
    </properties>
    <developers>
        <developer>
            <name>Alexander Patrikalakis</name>
            <email>amcp@me.com</email>
            <url>https://www.linkedin.com/in/amcpatrix/en</url>
        </developer>
        <developer>
            <name>Matthew Sowders</name>
            <email>matthewsowders@gmail.com</email>
            <url>https://www.linkedin.com/in/matthewsowders/en</url>
        </developer>
        <developer>
            <name>Michael Rodaitis</name>
            <email>mrodaitis@gmail.com</email>
        </developer>
        <developer>
            <name>Zameer Merali</name>
            <email>zmerali@amazon.com</email>
        </developer>
        <developer>
            <name>Justin Panian</name>
            <email>panianj@amazon.com</email>
        </developer>
    </developers>
    <inceptionYear>2014</inceptionYear>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <!-- Libraries -->
    <dependencies>
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-dynamodb</artifactId>
            <version>${aws.java.sdk.version}</version>
        </dependency>
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>DynamoDBLocal</artifactId>
            <version>${aws.java.sdk.version}</version>
        </dependency>
        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-core</artifactId>
            <version>${titan.version}</version>
        </dependency>
        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-test</artifactId>
            <version>${titan.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-es</artifactId>
            <version>${titan.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.codahale.metrics</groupId>
            <artifactId>metrics-core</artifactId>
            <version>${metrics3.version}</version>
        </dependency>
        <dependency>
            <groupId>au.com.bytecode</groupId>
            <artifactId>opencsv</artifactId>
            <version>${opencsv.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
            <version>${jackson2.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
        </dependency>

        <!-- Gremlin -->
        <dependency>
            <groupId>com.tinkerpop.gremlin</groupId>
            <artifactId>gremlin-groovy</artifactId>
            <version>${tinkerpop.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.tinkerpop.gremlin</groupId>
            <artifactId>gremlin-java</artifactId>
            <version>${tinkerpop.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.tinkerpop.gremlin</groupId>
            <artifactId>gremlin-test</artifactId>
            <version>${tinkerpop.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- for Gremlin console -->
        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-hadoop</artifactId>
            <version>${titan.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-client</artifactId>
            <version>${hadoop.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.version}</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven.resources.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${dependency.plugin.version}</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/dependencies</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>false</overWriteSnapshots>
                            <overWriteIfNewer>true</overWriteIfNewer>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>share</id>
            <activation>
                <file>
                    <exists>src/assembly/component.xml</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>${maven.assembly.plugin.version}</version>
                        <configuration>
                            <descriptors>
                                <descriptor>src/assembly/component.xml</descriptor>
                            </descriptors>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id> <!-- this is used for inheritance merges -->
                                <phase>package</phase> <!-- bind to the packaging phase -->
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>start-dynamodb-local</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>${exec.maven.plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>initialize</phase>
                                <configuration>
                                    <executable>java</executable>
                                    <arguments>
                                        <argument>-cp</argument>
                                        <classpath/>
                                        <argument>-Dsqlite4java.library.path=${basedir}/target/dependencies</argument>
                                        <argument>com.amazonaws.services.dynamodbv2.local.main.ServerRunner</argument>
                                        <argument>-inMemory</argument>
                                        <argument>-port</argument>
                                        <argument>${dynamodb-local.port}</argument>
                                    </arguments>
                                </configuration>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>example</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.surefire.version}</version>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <sqlite4java.library.path>${basedir}/target/dependencies</sqlite4java.library.path>
                                    </systemPropertyVariables>
                                    <includes>
                                        <include>**/SingleMarvelTest.java</include>
                                        <include>**/MultiMarvelTest.java</include>
                                    </includes>
                                    <skip>false</skip>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>integration-tests</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.surefire.version}</version>
                        <executions>
                            <execution>
                                <id>surefire-it</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <sqlite4java.library.path>${basedir}/target/dependencies</sqlite4java.library.path>
                                    </systemPropertyVariables>
                                    <includes>
                                        <include>**/*Test.java</include>
                                    </includes>
                                    <skip>false</skip>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>start-gremlin</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>${exec.maven.plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <configuration>
                                    <executable>java</executable>
                                    <arguments>
                                        <argument>-Dsqlite4java.library.path=${basedir}/target/dependencies</argument>
                                        <argument>-cp</argument>
                                        <argument>${basedir}/target/dependencies/*:${basedir}/target/dynamodb-titan054-storage-backend-1.0.0.jar</argument>
                                        <argument>com.thinkaurelius.titan.hadoop.tinkerpop.gremlin.Console</argument>
                                    </arguments>
                                </configuration>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <repositories>
        <repository>
            <id>dynamodblocal</id>
            <name>AWS DynamoDB Local Release Repository</name>
            <url>http://dynamodb-local.s3-website-us-west-2.amazonaws.com/release</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>com.almworks.sqlite4java</groupId>
                <artifactId>sqlite4java</artifactId>
                <version>${sqlite4java.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>${commons.logging.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>
