<!--
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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.tinkerpop</groupId>
        <artifactId>tinkerpop</artifactId>
        <version>3.0.0.M8-incubating</version>
    </parent>
    <artifactId>gremlin-server</artifactId>
    <name>Apache TinkerPop :: Gremlin Server</name>
    <dependencies>
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>tinkergraph-gremlin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-driver</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-groovy</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.1</version>
        </dependency>
        <!-- METRICS -->
        <dependency>
            <groupId>com.codahale.metrics</groupId>
            <artifactId>metrics-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.codahale.metrics</groupId>
            <artifactId>metrics-graphite</artifactId>
        </dependency>
        <dependency>
            <groupId>com.codahale.metrics</groupId>
            <artifactId>metrics-ganglia</artifactId>
        </dependency>
        <!-- TESTING -->
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-test</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.carrotsearch</groupId>
            <artifactId>junit-benchmarks</artifactId>
            <version>0.7.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.3.171</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.3.5</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <directory>${basedir}/target</directory>
        <finalName>${project.artifactId}-${project.version}</finalName>
        <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources
                </directory>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>${basedir}/src/test/resources
                </directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <attach>true</attach>
                    <descriptors>
                        <descriptor>src/assembly/standalone.xml</descriptor>
                        <descriptor>src/assembly/distribution.xml</descriptor>
                    </descriptors>
                    <finalName>apache-${project.artifactId}-${project.version}</finalName>
                    <outputDirectory>target</outputDirectory>
                    <workDirectory>target/assembly/work</workDirectory>
                    <tarLongFileMode>warn</tarLongFileMode>
                    <archive>
                        <manifest>
                            <mainClass>org.apache.tinkerpop.gremlin.console.Console</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>gatling</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>gatling</name>
                </property>
            </activation>

            <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <gatling.io.version>2.0.0-RC2</gatling.io.version>
                <scala.version>2.10</scala.version>
            </properties>

            <dependencies>
                <!-- include to resolve conflicts within gatling -->
                <dependency>
                    <groupId>com.typesafe</groupId>
                    <artifactId>config</artifactId>
                    <version>0.3.1</version>
                    <scope>test</scope>
                </dependency>
                <!-- include to resolve conflicts within gatling -->
                <dependency>
                    <groupId>org.scala-lang</groupId>
                    <artifactId>scala-reflect</artifactId>
                    <version>2.10.2</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>io.gatling</groupId>
                    <artifactId>gatling-core</artifactId>
                    <version>${gatling.io.version}</version>
                    <scope>test</scope>
                    <exclusions>
                        <!-- self-conflict -->
                        <exclusion>
                            <groupId>com.typesafe</groupId>
                            <artifactId>config</artifactId>
                        </exclusion>
                        <!-- conflict with tinkerpop -->
                        <exclusion>
                            <groupId>org.slf4j</groupId>
                            <artifactId>slf4j-api</artifactId>
                        </exclusion>
                        <!-- self-conflict -->
                        <exclusion>
                            <groupId>org.scala-lang</groupId>
                            <artifactId>scala-library</artifactId>
                        </exclusion>
                        <!-- self-conflict -->
                        <exclusion>
                            <groupId>org.scala-lang</groupId>
                            <artifactId>scala-reflect</artifactId>
                        </exclusion>
                        <!-- conflict with tinkerpop slf4j -->
                        <exclusion>
                            <groupId>ch.qos.logback</groupId>
                            <artifactId>logback-classic</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>org.scalaj</groupId>
                    <artifactId>scalaj-collection_${scala.version}</artifactId>
                    <version>1.5</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>io.gatling</groupId>
                    <artifactId>gatling-recorder</artifactId>
                    <version>${gatling.io.version}</version>
                    <scope>test</scope>
                    <exclusions>
                        <!-- conflict with tinkerpop slf4j -->
                        <exclusion>
                            <groupId>ch.qos.logback</groupId>
                            <artifactId>logback-classic</artifactId>
                        </exclusion>
                        <!-- conflict with tinkerpop -->
                        <exclusion>
                            <groupId>org.slf4j</groupId>
                            <artifactId>slf4j-api</artifactId>
                        </exclusion>
                        <!-- self-conflict -->
                        <exclusion>
                            <groupId>org.scala-lang</groupId>
                            <artifactId>scala-library</artifactId>
                        </exclusion>
                        <!-- self-conflict -->
                        <exclusion>
                            <groupId>io.netty</groupId>
                            <artifactId>netty</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>io.gatling.highcharts</groupId>
                    <artifactId>gatling-charts-highcharts</artifactId>
                    <version>${gatling.io.version}</version>
                    <scope>test</scope>
                    <exclusions>
                        <!-- conflict with tinkerpop -->
                        <exclusion>
                            <groupId>org.slf4j</groupId>
                            <artifactId>slf4j-api</artifactId>
                        </exclusion>
                        <!-- self-conflict -->
                        <exclusion>
                            <groupId>org.scala-lang</groupId>
                            <artifactId>scala-library</artifactId>
                        </exclusion>
                        <!-- self-conflict -->
                        <exclusion>
                            <groupId>org.scala-lang</groupId>
                            <artifactId>scala-compiler</artifactId>
                        </exclusion>
                        <!-- self-conflict -->
                        <exclusion>
                            <groupId>org.scala-lang</groupId>
                            <artifactId>scala-reflect</artifactId>
                        </exclusion>
                        <!-- conflict with gatling-core -->
                        <exclusion>
                            <groupId>com.typesafe.akka</groupId>
                            <artifactId>akka-actor_2.10</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>io.gatling</groupId>
                        <artifactId>gatling-maven-plugin</artifactId>
                        <version>${gatling.io.version}</version>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <configuration>
                                    <configDir>src/test/resources</configDir>
                                    <resultsFolder>target/gatling/results</resultsFolder>
                                    <simulationsFolder>src/test/scala</simulationsFolder>
                                    <includes>
                                        <include>**/*.scala</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

            <repositories>
                <repository>
                    <id>excilys</id>
                    <name>Excilys Repository</name>
                    <url>http://repository.excilys.com/content/groups/public</url>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>excilys</id>
                    <name>Excilys Repository</name>
                    <url>http://repository.excilys.com/content/groups/public</url>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
</project>
