<!--
  ~ 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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache</groupId>
        <artifactId>apache</artifactId>
        <version>23</version>
        <relativePath />
    </parent>
    <groupId>org.apache.sedona</groupId>
    <artifactId>sedona-parent</artifactId>
    <version>1.4.0</version>
    <packaging>pom</packaging>
    <name>sedona-parent</name>
    <url>http://sedona.apache.org/</url>
    <description>Apache Sedona is a cluster computing system for processing large-scale spatial data.
    </description>
    <developers>
        <developer><name>Apache Sedona</name></developer>
    </developers>
    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <mailingLists>
        <mailingList>
            <name>Sedona Developer List</name>
            <post>dev@sedona.apache.org</post>
            <subscribe>dev-subscribe@sedona.apache.org</subscribe>
            <unsubscribe>dev-unsubscribe@sedona.apache.org</unsubscribe>
        </mailingList>
    </mailingLists>
    <scm>
        <connection>scm:git:https://github.com/apache/sedona.git</connection>
        <developerConnection>scm:git:https://github.com/apache/sedona.git</developerConnection>
        <url>https://github.com/apache/sedona</url>
        <tag>sedona-1.4.0-rc1</tag>
    </scm>

    <properties>
        <project.scm.id>github</project.scm.id>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven.deploy.skip>false</maven.deploy.skip>
        <maven.compiler.plugin.version>3.10.1</maven.compiler.plugin.version>

        <cdm.version>5.4.2</cdm.version>
        <geotools.version>28.2</geotools.version>
        <hadoop.version>3.2.4</hadoop.version>
        <jackson.version>2.13.4</jackson.version>
        <jts.version>1.19.0</jts.version>
        <jts2geojson.version>0.16.1</jts2geojson.version>
        <log4j.version>2.17.2</log4j.version>
        <slf4j.version>1.7.36</slf4j.version>
        <spark.version>3.3.0</spark.version>
        <spark.compat.version>3.0</spark.compat.version>
        <googles2.version>2.0.0</googles2.version>

        <!-- Actual scala version will be set by a profile.
        Setting a default value helps IDE:s that can't make sense of profiles. -->
        <scala.compat.version>2.12</scala.compat.version>

        <geotools.scope>provided</geotools.scope>
        <!-- Because it's not in Maven central, make it provided by default -->
        <cdm.scope>provided</cdm.scope>

        <!-- For JDK-17 test -->
        <extraJavaTestArgs>
            -XX:+IgnoreUnrecognizedVMOptions
            --add-opens=java.base/java.lang=ALL-UNNAMED
            --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
            --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
            --add-opens=java.base/java.io=ALL-UNNAMED
            --add-opens=java.base/java.net=ALL-UNNAMED
            --add-opens=java.base/java.nio=ALL-UNNAMED
            --add-opens=java.base/java.util=ALL-UNNAMED
            --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
            --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
            --add-opens=java.base/sun.nio.ch=ALL-UNNAMED
            --add-opens=java.base/sun.nio.cs=ALL-UNNAMED
            --add-opens=java.base/sun.security.action=ALL-UNNAMED
            --add-opens=java.base/sun.util.calendar=ALL-UNNAMED
            -Djdk.reflect.useDirectMethodHandle=false
        </extraJavaTestArgs>
    </properties>

    <dependencies>
        <!-- Include junit automatically, projects must include scalatest themselves since not all use -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <!-- Include log4j deps for tests for consistent logging across modules-->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.wololo</groupId>
                <artifactId>jts2geojson</artifactId>
                <version>${jts2geojson.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.locationtech.jts</groupId>
                        <artifactId>jts-core</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.locationtech.jts</groupId>
                <artifactId>jts-core</artifactId>
                <version>${jts.version}</version>
            </dependency>
            <dependency>
                <groupId>edu.ucar</groupId>
                <artifactId>cdm-core</artifactId>
                <version>${cdm.version}</version>
                <scope>${cdm.scope}</scope>
            </dependency>
            <!--The following GeoTools dependencies use GNU Lesser General Public License and thus are excluded from the binary distribution-->
            <!-- Users have to include them by themselves manually -->
            <!-- See https://www.apache.org/legal/resolved.html#category-x -->
            <!-- See https://github.com/geotools/geotools#license -->
            <!--for CRS transformation-->
            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-main</artifactId>
                <version>${geotools.version}</version>
                <scope>${geotools.scope}</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.locationtech.jts</groupId>
                        <artifactId>jts-core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!--for CRS transformation-->
            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-referencing</artifactId>
                <version>${geotools.version}</version>
                <scope>${geotools.scope}</scope>
                <exclusions>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!--for CRS transformation-->
            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-epsg-hsql</artifactId>
                <version>${geotools.version}</version>
                <scope>${geotools.scope}</scope>
                <exclusions>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-shapefile</artifactId>
                <version>${geotools.version}</version>
                <scope>${geotools.scope}</scope>
                <exclusions>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!--for GeoTiff Reader-->
            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-geotiff</artifactId>
                <version>${geotools.version}</version>
                <scope>${geotools.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-arcgrid</artifactId>
                <version>${geotools.version}</version>
                <scope>${geotools.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-coverage</artifactId>
                <version>${geotools.version}</version>
                <scope>${geotools.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.spark</groupId>
                <artifactId>spark-core_2.12</artifactId>
                <version>${spark.version}</version>
                <scope>provided</scope>
                <!-- Exclude log4j 1 for older versions of Spark-->
                <exclusions>
                    <exclusion>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-log4j12</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.spark</groupId>
                <artifactId>spark-sql_2.12</artifactId>
                <version>${spark.version}</version>
                <scope>provided</scope>
            </dependency>
           <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-client</artifactId>
                <version>${hadoop.version}</version>
                <scope>provided</scope>
                <exclusions>
                    <exclusion>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>ch.qos.reload4j</groupId>
                        <artifactId>reload4j</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-1.2-api</artifactId>
                <version>${log4j.version}</version>
                <scope>provided</scope>
            </dependency>
            <!-- Just include log4j deps for tests for consistent logging across modules-->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>${log4j.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>2.6</version>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>${scala.version}</version>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-compiler</artifactId>
                <version>${scala.version}</version>
            </dependency>
            <dependency>
                <groupId>org.scala-lang.modules</groupId>
                <artifactId>scala-collection-compat_2.12</artifactId>
                <version>2.5.0</version>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest_2.12</artifactId>
                <version>3.1.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.google.geometry</groupId>
                <artifactId>s2-geometry</artifactId>
                <version>${googles2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-inline</artifactId>
                <version>4.11.0</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <repositories>
        <repository>
            <id>osgeo</id>
            <name>OSGeo Release Repository</name>
            <url>https://repo.osgeo.org/repository/release/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        <repository>
            <id>unidata-all</id>
            <name>Unidata All</name>
            <url>https://artifacts.unidata.ucar.edu/repository/unidata-all/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <version>3.2.1</version>
                    <executions>
                        <execution>
                            <id>scala-compile-first</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>add-source</goal>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <args>
                                    <arg>-dependencyfile</arg>
                                    <arg>${project.build.directory}/.scala_dependencies</arg>
                                </args>
                            </configuration>
                        </execution>
                        <execution>
                            <id>scala-test-compile</id>
                            <phase>process-test-resources</phase>
                            <goals>
                                <goal>testCompile</goal>
                            </goals>
                            <configuration>
                                <args>
                                    <arg>-dependencyfile</arg>
                                    <arg>${project.build.directory}/.scala_dependencies</arg>
                                </args>
                            </configuration>
                        </execution>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>doc-jar</goal>
                            </goals>
                            <configuration>
                                <args>
                                    <arg>${scaladoc.arg}</arg>
                                </args>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.plugin.version}</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.scalatest</groupId>
                    <artifactId>scalatest-maven-plugin</artifactId>
                    <version>2.2.0</version>
                    <configuration>
                        <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                        <junitxml>.</junitxml>
                        <filereports>TestSuiteReport.txt</filereports>
                        <argLine>${extraJavaTestArgs}</argLine>
                    </configuration>
                    <executions>
                        <execution>
                            <id>test</id>
                            <goals>
                                <goal>test</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.scalastyle</groupId>
                    <artifactId>scalastyle-maven-plugin</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <verbose>false</verbose>
                        <failOnViolation>true</failOnViolation>
                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        <failOnWarning>false</failOnWarning>
                        <sourceDirectory>${project.basedir}/src/main/scala</sourceDirectory>
                        <testSourceDirectory>${project.basedir}/src/test/scala</testSourceDirectory>
                        <configLocation>${project.basedir}/../scalastyle_config.xml</configLocation>
                        <outputFile>${project.basedir}/target/scalastyle-output.xml</outputFile>
                        <outputEncoding>UTF-8</outputEncoding>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.nicoulaj.maven.plugins</groupId>
                <artifactId>checksum-maven-plugin</artifactId>
                <version>1.9</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>artifacts</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <algorithms>
                        <algorithm>SHA-512</algorithm>
                    </algorithms>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <!-- This plugin is to replace property values in artifact names when publish -->
            <plugin>
                <groupId>io.paradoxical</groupId>
                <artifactId>resolved-pom-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <properties>
                        <spark.compat.version>3.0</spark.compat.version>
                        <scala.compat.version>2.12</scala.compat.version>
                    </properties>
                </configuration>
                <executions>
                    <execution>
                        <id>resolve-my-pom</id>
                        <phase>package</phase>
                        <goals>
                            <goal>resolve-pom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <argLine>${extraJavaTestArgs}</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <failOnError>false</failOnError>
                    <additionalparam>-Xdoclint:none</additionalparam>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <version>0.14</version>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>allow-snapshots</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
                <repository>
                    <id>snapshots-repo</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
        <profile>
            <id>scala2.13</id>
            <activation>
                <property>
                    <name>scala</name>
                    <value>2.13</value>
                </property>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <scala.version>2.13.8</scala.version>
                <scala.compat.version>2.13</scala.compat.version>
                <scaladoc.arg>-no-java-comments</scaladoc.arg>
                <!-- Skip deploying parent module for Scala 2.13 profile, it will be deployed with 2.12 -->
                <maven.deploy.skip>true</maven.deploy.skip>
            </properties>
            <modules>
                <module>common</module>
                <module>core</module>
                <module>sql</module>
                <module>viz</module>
                <module>python-adapter</module>
                <module>spark-shaded</module>
            </modules>
        </profile>
        <profile>
            <id>scala2.12</id>
            <activation>
                <property>
                    <name>scala</name>
                    <value>2.12</value>
                </property>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <scala.version>2.12.15</scala.version>
                <scala.compat.version>2.12</scala.compat.version>
                <scaladoc.arg>-no-java-comments</scaladoc.arg>
            </properties>
            <modules>
                <module>common</module>
                <module>core</module>
                <module>sql</module>
                <module>viz</module>
                <module>python-adapter</module>
                <module>spark-shaded</module>
                <module>flink</module>
                <module>flink-shaded</module>
            </modules>
        </profile>
    </profiles>
</project>
