<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>
        <artifactId>atlas-graphdb</artifactId>
        <groupId>org.apache.atlas</groupId>
        <version>0.9-SNAPSHOT</version>
    </parent>
    <artifactId>atlas-graphdb-titan0</artifactId>
    <description>Apache Atlas Titan 0.5.4 Graph DB Impl</description>
    <name>Apache Atlas Titan 0.5.4 Graph DB Impl</name>
    <packaging>jar</packaging>

    <properties>
        <tinkerpop.version>2.6.0</tinkerpop.version>
        <titan.version>0.5.4</titan.version>
        <checkstyle.failOnViolation>false</checkstyle.failOnViolation>
    <guava.version>14.0</guava.version>
    </properties>

     <profiles>
        <profile>
            <id>titan0</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.18.1</version>
                        <configuration>
                            <skip>${skipUTs}</skip>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>

        <!-- for graphdb interface definitions -->
        <dependency>
            <groupId>org.apache.atlas</groupId>
            <artifactId>atlas-graphdb-api</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

       <dependency>
            <groupId>org.apache.atlas</groupId>
            <artifactId>atlas-graphdb-common</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>

        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-core</artifactId>
            <version>${titan.version}</version>
        </dependency>

        <dependency>
            <groupId>com.tinkerpop.blueprints</groupId>
            <artifactId>blueprints-core</artifactId>
            <version>${tinkerpop.version}</version>
        </dependency>

        <dependency>
            <groupId>com.tinkerpop.gremlin</groupId>
            <artifactId>gremlin-java</artifactId>
            <version>${tinkerpop.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.atlas</groupId>
            <artifactId>atlas-hbase-client-shaded</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-core</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-solrj</artifactId>
        </dependency>

        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-es</artifactId>
            <version>${titan.version}</version>
        </dependency>

        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-berkeleyje</artifactId>
            <version>${titan.version}</version>
        </dependency>

        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-lucene</artifactId>
            <version>${titan.version}</version>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.atlas</groupId>
            <artifactId>atlas-graphdb-common</artifactId>
            <version>${project.version}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <!--
                 Create 'uber' jar that contains all of the dependencies (except those whose scope is provided)
                 Only Titan 0.5.4 and its dependencies are included.  The other dependencies are bundled in the war file.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.4.3</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>false</shadedArtifactAttached>
                            <artifactSet>
                                <excludes>
                                    <!-- these are bundled with Atlas -->
                                    <exclude>org.slf4j:*</exclude>
                                </excludes>
                            </artifactSet>
                            <filters>
                                <filter>
                                    <artifact>com.thinkaurelius.titan:titan-core</artifact>
                                    <!-- force use of our custom titan class implementations -->
                                    <excludes>
                                        <exclude>com/thinkaurelius/titan/diskstorage/locking/LocalLockMediator.class</exclude>
                                        <exclude>com/thinkaurelius/titan/graphdb/query/graph/GraphCentricQueryBuilder.class</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                            <relocations>
                                <!-- guava has incompatibilities across its versions. Titan requires different version of guava than the version that atlas needs.
                                 So, shading the guava reference in titan -->
                                <relocation>
                                    <pattern>com.google</pattern>
                                    <shadedPattern>atlas.shaded.titan.guava</shadedPattern>
                                </relocation>
                            </relocations>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <excludes>
                        <exclude>**/log4j.xml</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.2.0</version>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <!-- Graph DB -->
            <dependency>
                <groupId>com.tinkerpop.blueprints</groupId>
                <artifactId>blueprints-core</artifactId>
                <version>${tinkerpop.version}</version>
            </dependency>

            <dependency>
                <groupId>com.thinkaurelius.titan</groupId>
                <artifactId>titan-core</artifactId>
                <version>${titan.version}</version>
                <exclusions>
                    <!-- rexster does not work with servlet-api -->
                    <exclusion>
                        <groupId>com.tinkerpop.rexster</groupId>
                        <artifactId>rexster-core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.tinkerpop.rexster</groupId>
                        <artifactId>rexster-server</artifactId>
                    </exclusion>
                    <!-- asm 4.0 does not work with jersey asm 3.1 -->
                    <exclusion>
                        <groupId>com.tinkerpop</groupId>
                        <artifactId>frames</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.esotericsoftware.reflectasm</groupId>
                        <artifactId>reflectasm</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.ow2.asm</groupId>
                        <artifactId>asm</artifactId>
                    </exclusion>
                    <exclusion> <!-- GPL license imported from ganglia -->
                        <groupId>org.acplt</groupId>
                        <artifactId>oncrpc</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>com.thinkaurelius.titan</groupId>
                <artifactId>titan-berkeleyje</artifactId>
                <version>${titan.version}</version>
            </dependency>

            <dependency>
                <groupId>com.thinkaurelius.titan</groupId>
                <artifactId>titan-hbase</artifactId>
                <version>${titan.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>
</project>
