<!--
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.5.1</version>
    </parent>
    <artifactId>gremlin-driver</artifactId>
    <name>Apache TinkerPop :: Gremlin Driver</name>
    <dependencies>
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-all</artifactId>
            <version>${netty.version}</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy</artifactId>
            <version>${groovy.version}</version>
            <classifier>indy</classifier>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-json</artifactId>
            <version>${groovy.version}</version>
            <classifier>indy</classifier>
            <exclusions>
                <!-- exclude non-indy type -->
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy</artifactId>
                </exclusion>
            </exclusions>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <optional>true</optional>
        </dependency>
        <!-- TinkerGraph is an optional dependency that is only required if doing deserialization of Graph instances -->
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>tinkergraph-gremlin</artifactId>
            <version>${project.version}</version>
            <optional>true</optional>
        </dependency>
        <!-- TEST -->
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-test</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito2</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <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>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <attach>true</attach>
                    <descriptors>
                        <descriptor>src/assembly/standalone.xml</descriptor>
                    </descriptors>
                    <finalName>apache-tinkerpop-${project.artifactId}-${project.version}</finalName>
                    <outputDirectory>target</outputDirectory>
                    <workDirectory>target/assembly/work</workDirectory>
                    <tarLongFileMode>warn</tarLongFileMode>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadeSourcesContent>true</shadeSourcesContent>
                            <createSourcesJar>true</createSourcesJar>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>shaded</shadedClassifierName>
                            <artifactSet>
                                <!-- exclude logging stuff from uberjar - shading prevents proper logger initialization -->
                                <!-- exclude groovy as it's only needed for json serialization and is an optional dependency -->
                                <excludes>
                                    <exclude>log4j:log4j</exclude>
                                    <exclude>org.slf4j:slf4j-log4j12</exclude>
                                    <exclude>org.slf4j:slf4j-api</exclude>
                                    <exclude>org.slf4j:jcl-over-slf4j</exclude>
                                    <exclude>org.codehaus.groovy:groovy</exclude>
                                    <exclude>org.codehaus.groovy:groovy-json</exclude>
                                </excludes>
                            </artifactSet>
                            <relocations>
                                <relocation>
                                    <pattern>com.carrotsearch</pattern>
                                    <shadedPattern>com.shaded.carrotsearch</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.jcabi</pattern>
                                    <shadedPattern>com.shaded.jcabi</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.squareup</pattern>
                                    <shadedPattern>com.shaded.squareup</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>io.netty</pattern>
                                    <shadedPattern>io.shaded.netty</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>net.objecthunter</pattern>
                                    <shadedPattern>net.shaded.carrotsearch</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.apache.commons</pattern>
                                    <shadedPattern>org.shaded.apache.commons</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.javatuples</pattern>
                                    <shadedPattern>org.shaded.javatuples</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.yaml</pattern>
                                    <shadedPattern>org.shaded.yaml</shadedPattern>
                                </relocation>
                            </relocations>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                                    <resources>
                                        <resource>LICENSE.txt</resource>
                                        <resource>LICENSE</resource>
                                        <resource>NOTICE.txt</resource>
                                        <resource>NOTICE</resource>
                                        <resource>licenses</resource>
                                    </resources>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                                    <resource>META-INF/LICENSE</resource>
                                    <file>src/main/static/LICENSE</file>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                                    <resource>META-INF/NOTICE</resource>
                                    <file>src/main/static/NOTICE</file>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                                    <resource>META-INF/licenses/jcabi-log</resource>
                                    <file>src/main/static/licenses/jcabi-log</file>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                                    <resource>META-INF/licenses/jcabi-manifests</resource>
                                    <file>src/main/static/licenses/jcabi-manifests</file>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                                    <resource>META-INF/licenses/kryo</resource>
                                    <file>src/main/static/licenses/kryo</file>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                                    <resource>META-INF/licenses/minlog</resource>
                                    <file>src/main/static/licenses/minlog</file>
                                </transformer>
                            </transformers>>
                        </configuration>
                    </execution>
                </executions>
            </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>
                <executions>
                    <execution>
                        <id>integration-test</id>
                    </execution>
                    <execution>
                        <id>performance-test</id>
                    </execution>
                    <execution>
                        <id>verify-integration-test</id>
                    </execution>
                    <execution>
                        <id>verify-performance-test</id>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
