<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.janusgraph</groupId>
        <artifactId>janusgraph</artifactId>
        <version>0.4.1</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>janusgraph-core</artifactId>
    <name>JanusGraph-Core: Core Library for JanusGraph</name>
    <url>https://janusgraph.org</url>

    <properties>
        <top.level.basedir>${basedir}/..</top.level.basedir>
    </properties>

    <dependencies>
        <!-- TinkerPop -->
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-core</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>gossip</artifactId>
                    <groupId>org.sonatype.gossip</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-groovy</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>tinkergraph-gremlin</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-server</artifactId>
            <optional>true</optional>
        </dependency>
        <!-- Utility -->
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-ganglia</artifactId>
            <exclusions>
                <!-- LGPL licensed - users will need to install this jar manually -->
                <exclusion>
                    <groupId>org.acplt</groupId>
                    <artifactId>oncrpc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-graphite</artifactId>
        </dependency>
        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
        </dependency>
        <dependency>
            <groupId>org.locationtech.spatial4j</groupId>
            <artifactId>spatial4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.locationtech.jts</groupId>
            <artifactId>jts-core</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>com.carrotsearch</groupId>
            <artifactId>hppc</artifactId>
        </dependency>
        <dependency>
            <groupId>com.boundary</groupId>
            <artifactId>high-scale-lib</artifactId>
        </dependency>
       <dependency>
           <groupId>com.google.code.findbugs</groupId>
           <artifactId>jsr305</artifactId>
       </dependency>
       <!-- The Noggit JSON parsing library is needed for GeoJSON parsing -->
       <dependency>
           <groupId>org.noggit</groupId>
           <artifactId>noggit</artifactId>
           <version>0.6</version>
       </dependency>
       <!-- We keep the gremlin version of org.apache.commons commons-lang3 -->
       <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <version>1.0</version>
            <exclusions>
                 <exclusion>
                      <groupId>org.apache.commons</groupId>
                      <artifactId>commons-lang3</artifactId>
                  </exclusion>
             </exclusions>
       </dependency>
    </dependencies>
    <build>
        <directory>${basedir}/target</directory>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>${basedir}/src/test/resources
                </directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <version>${gmavenplus.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generateStubs</goal>
                            <goal>compile</goal>
                            <goal>testGenerateStubs</goal>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <providerSelection>1.8</providerSelection>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Gremlin-Plugin-Dependencies>org.janusgraph:janusgraph-cassandra:${project.version};org.janusgraph:janusgraph-hadoop:${project.version}</Gremlin-Plugin-Dependencies>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <windowtitle>JanusGraph ${project.version} API</windowtitle>
                            <doctitle>JanusGraph ${project.version} API</doctitle>
                            <!-- Quiet mode still shows warnings and errors -->
                            <quiet>true</quiet>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>shade-gremlin-groovy</id>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <artifactSet>
                                <includes>
                                    <include>com.esotericsoftware.kryo:*</include>
                                    <include>com.esotericsoftware.minlog:*</include>
                                    <include>com.esotericsoftware.reflectasm:*</include>
                                    <include>org.objenesis:*</include>
                                </includes>
                            </artifactSet>
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/MANIFEST.MF</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                            <relocations>
                                <relocation>
                                    <pattern>com.esotericsoftware.kryo</pattern>
                                    <shadedPattern>org.janusgraph.shaded.kryo_2_24_0</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.esotericsoftware.minlog</pattern>
                                    <shadedPattern>org.janusgraph.shaded.minlog_1_2</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.esotericsoftware.reflectasm</pattern>
                                    <shadedPattern>org.janusgraph.shaded.kryo_2_24_0_reflectasm</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.objenesis</pattern>
                                    <shadedPattern>org.janusgraph.shaded.objenesis_2_1</shadedPattern>
                                </relocation>
                            </relocations>
                            <!-- false below means the shade plugin overwrites the main project artifact (the one with no classifier).
                                 false does *not* actually detach the main artifact, despite what the option name suggests. -->
                            <shadedArtifactAttached>false</shadedArtifactAttached>
                            <minimizeJar>false</minimizeJar>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

    <profiles>
        <!-- This profile forces gpg-plugin to run after shade-plugin.
             Otherwise, Maven will sign the unshaded jar, then shade the jar
             (giving it completely different contents and breaking the sig) -->
        <profile>
            <id>janusgraph-release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-shade-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>shade-gremlin-groovy</id>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
