<?xml version="1.0" encoding="UTF-8"?>
<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>com.github.davidmoten</groupId>
        <artifactId>sonatype-parent</artifactId>
        <version>0.1</version>
    </parent>

    <artifactId>rtree</artifactId>
    <version>0.12</version>

    <name>${project.artifactId}</name>
    <description>Java implementation of an immutable in-memory R-Tree for spatial indexing</description>
    <packaging>bundle</packaging>

    <url>http://github.com/davidmoten/rtree</url>

    <properties>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <scm.url>scm:git:https://github.com/davidmoten/rtree.git</scm.url>
        <slf4j.version>1.7.12</slf4j.version>

        <checkstyle.version>3.5.0</checkstyle.version>
        <javadoc.version>3.8.0</javadoc.version>
        <pmd.version>3.24.0</pmd.version>
        <jdepend.version>2.0</jdepend.version>
        <project.info.version>3.7.0</project.info.version>
        <jxr.version>3.5.0</jxr.version>
        <taglist.version>3.1.0</taglist.version>
        <m3.site.version>3.20.0</m3.site.version>
        <changelog.version>2.2</changelog.version>
        <coverage.reports.dir>${project.build.directory}/target/coverage-reports</coverage.reports.dir>
        <!-- keep jmh at 1.11.3 to support java 6 -->
        <jmh.version>1.37</jmh.version>
        <jacoco.version>0.8.12</jacoco.version>

    </properties>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <ciManagement>
        <system>Travis</system>
        <url>https://travis-ci.org/davidmoten/rtree</url>
    </ciManagement>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/davidmoten/rtree/issues</url>
    </issueManagement>

    <inceptionYear>2013</inceptionYear>
    <developers>
        <developer>
            <id>dave</id>
            <name>Dave Moten</name>
            <url>https://github.com/davidmoten/</url>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>+10</timezone>
        </developer>
    </developers>

    <scm>
        <connection>${scm.url}</connection>
        <developerConnection>${scm.url}</developerConnection>
        <url>${scm.url}</url>
        <tag>0.12</tag>
    </scm>

    <dependencies>
        <dependency>
            <groupId>com.github.davidmoten</groupId>
            <artifactId>guava-mini</artifactId>
            <version>0.1.7</version>
        </dependency>
        <dependency>
            <groupId>io.reactivex</groupId>
            <artifactId>rxjava</artifactId>
            <version>1.3.8</version>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.google.flatbuffers</groupId>
            <artifactId>flatbuffers-java</artifactId>
            <version>2.0.8</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>io.reactivex</groupId>
            <artifactId>rxjava-string</artifactId>
            <version>1.1.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.github.davidmoten</groupId>
            <artifactId>grumpy-core</artifactId>
            <version>0.4.8</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-core</artifactId>
            <version>${jmh.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-generator-annprocess</artifactId>
            <version>${jmh.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>4.11.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.github.davidmoten</groupId>
            <artifactId>junit-extras</artifactId>
            <version>0.4</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.esotericsoftware</groupId>
            <artifactId>kryo</artifactId>
            <version>5.3.0</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.2</version>
            <optional>true</optional>
        </dependency>

    </dependencies>

    <profiles>
        <profile>
            <id>fbs</id>
            <properties>
                <fbs.sources>${basedir}/src/main/fbs</fbs.sources>
                <fbs.generated.sources>${project.build.directory}/fbs-generated/java</fbs.generated.sources>
                <fbs.dest>${basedir}/src/main/java/com/github/davidmoten/rtree/fbs/generated</fbs.dest>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>3.8.0</version>
                        <executions>
                            <execution>
                                <id>unpack</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>com.github.davidmoten</groupId>
                                            <artifactId>flatbuffers-compiler</artifactId>
                                            <version>2.0.8</version>
                                            <type>tar.gz</type>
                                            <classifier>distribution-linux</classifier>
                                            <overWrite>true</overWrite>
                                            <outputDirectory>${project.build.directory}</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>3.4.1</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <phase>generate-sources</phase>
                            </execution>
                        </executions>
                        <configuration>
                            <executable>${project.build.directory}/bin/flatc</executable>
                            <workingDirectory>${fbs.sources}</workingDirectory>
                            <arguments>
                                <argument>--java</argument>
                                <argument>-o</argument>
                                <argument>${fbs.generated.sources}</argument>
                                <argument>rtree.fbs</argument>
                            </arguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <target>
                                        <echo message="${fbs.dest}" />
                                        <delete verbose="true">
                                            <fileset dir="${fbs.dest}" includes="*.java" />
                                        </delete>
                                        <copy todir="${basedir}/src/main/java" overwrite="true">
                                            <fileset dir="${fbs.generated.sources}">
                                                <include name="**/*.java" />
                                            </fileset>
                                        </copy>
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <excludes>
                                        <exclude>**/PriorityQueue.*</exclude>
                                        <exclude>**/generated/**/*</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>benchmark</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>3.4.1</version>
                        <executions>
                            <execution>
                                <id>run-benchmarks</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <classpathScope>test</classpathScope>
                                    <executable>java</executable>
                                    <arguments>
                                        <argument>-classpath</argument>
                                        <classpath />
                                        <argument>org.openjdk.jmh.Main</argument>
                                        <!-- -h for help -->
                                        <argument>-f</argument>
                                        <argument>1</argument>
                                        <argument>-i</argument>
                                        <argument>10</argument>
                                        <argument>-wi</argument>
                                        <argument>3</argument>
                                        <argument>-jvmArgs</argument>
                                        <argument>-Xmx512m</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>gallery</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>3.4.1</version>
                        <executions>
                            <execution>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <classpathScope>test</classpathScope>
                            <mainClass>com.github.davidmoten.rtree.GalleryMain</mainClass>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>5.1.9</version>
                <extensions>true</extensions>
                <configuration>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-site-plugin</artifactId>
                <version>${m3.site.version}</version>
                <executions>
                    <execution>
                        <id>attach-descriptor</id>
                        <goals>
                            <goal>attach-descriptor</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <exclude>**/PriorityQueue.*</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${javadoc.version}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <source>8</source>
                            <additionalJOption>-Xdoclint:none</additionalJOption>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <excludeDefaults>true</excludeDefaults>
        <outputDirectory>${project.build.directory}/site</outputDirectory>
        <plugins>
            <!-- this one should go first so that it is available to other 
                plugins when they run -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>${jxr.version}</version>
                <configuration>
                    <aggregate>true</aggregate>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle.version}</version>
                <configuration>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>${pmd.version}</version>
                <configuration>
                    <targetJdk>${maven.compiler.target}</targetJdk>
                    <aggregate>true</aggregate>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jdepend-maven-plugin</artifactId>
                <version>${jdepend.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${project.info.version}</version>
                <configuration>
                    <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>taglist-maven-plugin</artifactId>
                <version>${taglist.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${javadoc.version}</version>
                <configuration>
                    <aggregate>true</aggregate>
                </configuration>
            </plugin>
            <!-- commented this plugin out because cannot run offline (e.g. 
                at home) -->
            <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-changelog-plugin</artifactId> 
                <version>${changelog.version}</version> <configuration> <username>${svn.username}</username> 
                <password>${svn.password}</password> </configuration> </plugin> -->
        </plugins>
    </reporting>
</project>
