<?xml version="1.0" encoding="UTF-8"?>

<!--
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //
 // © 2011-2022 Telenav, Inc.
 // Licensed under Apache License, Version 2.0
 //
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 -->

<project xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns = "http://maven.apache.org/POM/4.0.0"
         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>

    <groupId>com.telenav.mesakit</groupId>
    <artifactId>mesakit-extensions-parent</artifactId>
    <version>0.9.21</version>

    <packaging>pom</packaging>

    <!-- Project -->

    <name>mesakit-extensions-parent</name>
    <description>MesaKit extensions contains modules that extend MesaKit</description>
    <url>https://www.mesakit.org</url>
    <inceptionYear>2011</inceptionYear>
    <organization>
        <name>Telenav</name>
        <url>https://www.telenav.com</url>
    </organization>

    <!-- Licensing -->

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <!-- Modules -->

    <modules>

        <module>mesakit-extensions</module>
        <module>mesakit-tools/applications/pbf-dumper</module>
        <module>mesakit-tools/application-launcher</module>
        <module>mesakit-tools/applications/region-information</module>
        <module>mesakit-tools/applications/pbf-world-graph-extractor</module>
        <module>mesakit-plugins/josm/graph</module>
        <module>mesakit-tools/applications/graph-dumper</module>
        <module>mesakit-plugins/josm/geojson</module>
        <module>mesakit-tools/applications/codec-generator</module>
        <module>mesakit-tools/applications/graph-slicer</module>
        <module>mesakit-tools/applications/graph-to-pbf-converter</module>
        <module>mesakit-tools/applications/pbf-comparator</module>
        <module>mesakit-serialization/json</module>
        <module>mesakit-tools/applications/graph-verifier</module>
        <module>mesakit-tools/applications/graph-double-digitized-ways-extractor</module>
        <module>mesakit-tools/applications/pbf-to-graph-converter</module>
        <module>mesakit-geocoding</module>
        <module>mesakit-tools/applications/pbf-analyzer</module>
        <module>mesakit-tools/applications/pbf-metadata</module>
        <module>mesakit-tools/applications/graph-analyzer</module>
        <module>mesakit-tools/applications/pbf-filter</module>
        <module>mesakit-tools/applications/pbf-region-extractor</module>
        <module>mesakit-plugins/josm/library</module>

    </modules>

    <!-- Versioning -->

    <properties>

        <!-- Project -->

        <repository.group.name>mesakit</repository.group.name>
        <repository.name>mesakit-extensions</repository.name>

        <!-- Tools -->

        <java.version>17</java.version>
        <maven.version>3.8.5</maven.version>
        <cactus.version>1.5.49</cactus.version>
        <lexakai.version>1.0.20</lexakai.version>
        <module.info.synthesizer.version>1.0.2</module.info.synthesizer.version>

        <!-- Telenav -->

        <kivakit.version>1.8.5</kivakit.version>

        <!-- Plugins -->

        <maven.compiler.plugin.version>3.10.1</maven.compiler.plugin.version>
        <maven.enforcer.plugin.version>3.1.0</maven.enforcer.plugin.version>
        <maven.jar.plugin.version>3.3.0</maven.jar.plugin.version>
        <maven.shade.plugin.version>3.3.0</maven.shade.plugin.version>
        <maven.resources.plugin.version>3.3.0</maven.resources.plugin.version>
        <maven.source.plugin.version>3.2.1</maven.source.plugin.version>
        <maven.moditect.plugin.version>1.0.0.RC1</maven.moditect.plugin.version>
        <maven.plugin.plugin.version>3.7.0</maven.plugin.plugin.version>
        <maven.surefire.plugin.version>3.0.0-M7</maven.surefire.plugin.version>
        <maven.javadoc.plugin.version>3.4.1</maven.javadoc.plugin.version>
        <maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
        <maven.nexus.staging.plugin.version>1.6.13</maven.nexus.staging.plugin.version>
        <maven.deploy.plugin.version>3.0.0</maven.deploy.plugin.version>
        <maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
        <maven.javadoc.plugin.version>3.4.1</maven.javadoc.plugin.version>
        <maven.resources.plugin.version>3.3.0</maven.resources.plugin.version>
        <maven.os.plugin.version>1.6.1</maven.os.plugin.version>
        <maven.protobuf.plugin.version>0.6.1</maven.protobuf.plugin.version>
        <maven.antrun.plugin.version>3.1.0</maven.antrun.plugin.version>
        <maven.install.plugin.version>3.0.1</maven.install.plugin.version>
        <maven.cactus.plugin.version>1.5.49</maven.cactus.plugin.version>

        <!-- Documentation -->

        <!--suppress UnresolvedMavenProperty -->
        <documentation.assets.folder>${env.TELENAV_WORKSPACE}/${repository.group.name}-assets/docs/${project.version}</documentation.assets.folder>
        <documentation.lexakai.folder>${documentation.assets.folder}/lexakai</documentation.lexakai.folder>
        <documentation.javadoc.folder>${documentation.assets.folder}/javadoc/${repository.name}</documentation.javadoc.folder>
        <documentation.javadoc.source.version>17</documentation.javadoc.source.version>
        <documentation.lexakai.downloads.folder>${env.HOME}/.lexakai/downloads</documentation.lexakai.downloads.folder>

        <!-- Publishing -->

        <nexus.deploy.skip>false</nexus.deploy.skip>
        <nexus.release>true</nexus.release>

        <!-- Annotations -->

        <annotations.lexakai.annotations.version>1.0.9</annotations.lexakai.annotations.version>
        <annotations.jetbrains.annotations.version>23.0.0</annotations.jetbrains.annotations.version>

        <!-- Serialization -->

        <serialization.kryo.version>5.3.0</serialization.kryo.version>
        <serialization.kryo.serializers.version>0.45</serialization.kryo.serializers.version>
        <serialization.gson.version>2.10</serialization.gson.version>
        <serialization.protobuf.version>3.21.9</serialization.protobuf.version>
        <serialization.jackson.version>2.14.0</serialization.jackson.version>
        <serialization.snake.yaml.version>1.33</serialization.snake.yaml.version>

        <!-- Cloud -->

        <cloud.aws.s3.version>2.17.31</cloud.aws.s3.version>
        <cloud.aws.lambda.version>1.2.1</cloud.aws.lambda.version>
        <cloud.zookeeper.version>1.5.8</cloud.zookeeper.version>

        <!-- Data -->

        <data.compression.commons.codec.version>1.15</data.compression.commons.codec.version>

        <!-- OpenStreetMap -->

        <mapping.josm.version>17428</mapping.josm.version>

        <!-- Networking -->

        <networking.httpclient.version>4.5.13</networking.httpclient.version>

        <!-- Web -->

        <web.netty.version>4.1.84.Final</web.netty.version>

        <!-- Utilities -->

        <utilities.guava.version>31.1-jre</utilities.guava.version>
        <utilities.classgraph.version>4.8.149</utilities.classgraph.version>
        <utilities.log4j.version>2.19.0</utilities.log4j.version>
        <utilities.cactus.metadata.version>1.0.2</utilities.cactus.metadata.version>

        <!-- Testing -->

        <testing.junit.version>4.13.2</testing.junit.version>
        <testing.junit5.version>5.9.1</testing.junit5.version>
        <testing.junit.platform.version>1.9.1</testing.junit.platform.version>
        <testing.surefire.excluded/>
        <testing.surefire.quick>false</testing.surefire.quick>

    </properties>

    <!-- Contributors -->

    <developers>

        <developer>
            <id>jonathanl</id>
            <name>Jonathan Locke (Luo Shibo)</name>
            <email>jonathanl@telenav.com</email>
            <organization>Telenav</organization>
            <organizationUrl>https://www.telenav.com/</organizationUrl>
            <roles>
                <role>lead</role>
                <role>administrator</role>
            </roles>
        </developer>

        <developer>
            <id>haifeng</id>
            <name>Haifeng Zhu</name>
            <email>hfzhu@telenav.com</email>
            <organization>Telenav</organization>
            <organizationUrl>https://www.telenav.com/</organizationUrl>
            <roles>
                <role>developer</role>
                <role>administrator</role>
            </roles>
        </developer>

        <developer>
            <id>timboudreau</id>
            <name>Tim Boudreau</name>
            <email>tim@timboudreau.com</email>
            <organization>Telenav</organization>
            <organizationUrl>https://www.telenav.com/</organizationUrl>
            <roles>
                <role>developer</role>
                <role>administrator</role>
            </roles>
        </developer>

    </developers>

    <!-- Maven central staging-->

    <distributionManagement>

        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>

    </distributionManagement>

    <!-- Repositories -->

    <repositories>

        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>central</id>
            <name>Maven Central</name>
            <url>https://repo.maven.apache.org/maven2/</url>
        </repository>

        <repository>
            <id>josm</id>
            <name>openstreetmap josm</name>
            <url>https://josm.openstreetmap.de/nexus/content/repositories/releases/</url>
        </repository>

    </repositories>

    <!-- Source Code -->

    <scm>

        <connection>scm:git:https://github.com/Telenav/${repository.name}.git</connection>
        <developerConnection>scm:git:https://github.com/Telenav/${repository.name}.git</developerConnection>
        <url>https://github.com/Telenav/${repository.name}.git</url>

    </scm>

    <!-- Issue Tracking -->

    <issueManagement>

        <system>GitHub</system>
        <url>https://github.com/Telenav/${repository.group.name}/issues</url>

    </issueManagement>

    <build>

        <!-- Resource Copying -->

        <resources>
            <resource>
                <directory>${project.basedir}/src/main/java</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>

        <testResources>
            <testResource>
                <directory>${project.basedir}/src/test/java</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </testResource>
        </testResources>

        <!-- Plugins -->

        <plugins>

            <!-- Building -->

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <release>${java.version}</release>
                    <compilerArgs>
                        <compilerArg>-Xlint:unchecked</compilerArg>
                        <compilerArg>-Xlint:-requires-transitive-automatic</compilerArg>
                        <compilerArg>-Xlint:deprecation</compilerArg>
                    </compilerArgs>
                </configuration>
            </plugin>

            <!-- Enforce Maven version -->

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven.enforcer.plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <phase>verify</phase>
                        <configuration>
                            <rules>
                                <dependencyConvergence/>
                                <requireMavenVersion>
                                    <version>[${maven.version},)</version>
                                    <message>Build requires Maven version ${maven.version}.</message>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Generate build.properties and project.properties files -->

            <plugin>
                <groupId>com.telenav.cactus.metadata</groupId>
                <artifactId>cactus-metadata-maven-plugin</artifactId>
                <version>${utilities.cactus.metadata.version}</version>
                <executions>
                    <execution>
                        <id>project-metadata</id>
                        <phase>generate-resources</phase>
                        <configuration>
                            <verb>Updating project and build metadata</verb>
                        </configuration>
                        <goals>
                            <goal>project-information</goal>
                            <goal>build-metadata</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Create Javadoc site -->

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.plugin.version}</version>
                <configuration>
                    <show>protected</show>
                    <quiet>true</quiet>
                    <source>${documentation.javadoc.source.version}</source>
                    <encoding>utf-8</encoding>
                    <sourcepath>src/main/java</sourcepath>
                    <failOnError>true</failOnError>
                    <detectJavaApiLink>false</detectJavaApiLink>
                    <doclint>none</doclint>
                    <nohelp>true</nohelp>
                    <additionalOptions>-notimestamp</additionalOptions>
                    <!--suppress CheckTagEmptyBody -->
                    <destDir></destDir>
                    <sourceFileIncludes>
                        <sourceFileInclude>**/*.java</sourceFileInclude>
                    </sourceFileIncludes>
                </configuration>
                <executions>
                    <execution>
                        <id>aggregate</id>
                        <phase>site</phase>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${documentation.javadoc.folder}</outputDirectory>
                            <reportOutputDirectory>${documentation.javadoc.folder}</reportOutputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>attach-javadoc-jar</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>

        <pluginManagement>

            <plugins>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${maven.plugin.plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven.resources.plugin.version}</version>
                    <configuration>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                    <configuration>
                        <systemPropertyVariables>
                            <unit.test>true</unit.test>
                        </systemPropertyVariables>
                        <argLine>-Xmx2g</argLine>
                    </configuration>
                </plugin>

            </plugins>

        </pluginManagement>

    </build>

    <!-- Build Profiles -->

    <profiles>

        <profile>

            <id>release</id>

            <build>
                <plugins>

                    <!-- Create source JAR -->

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven.source.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-source-jar</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Documentation - CodeFlowers, Replace Versions -->

                    <plugin>
                        <groupId>com.telenav.cactus</groupId>
                        <artifactId>cactus-maven-plugin</artifactId>
                        <version>${maven.cactus.plugin.version}</version>
                        <configuration>
                            <scope>family</scope>
                            <verbose>true</verbose>
                            <includeRoot>true</includeRoot>
                            <tolerateVersionInconsistenciesIn>lexakai</tolerateVersionInconsistenciesIn>
                        </configuration>
                        <executions>
                            <!--
                            <execution>
                                <id>replace-versions</id>
                                <goals>
                                    <goal>replace</goal>
                                </goals>
                                <configuration>
                                    <newVersion>${project.version}</newVersion>
                                    <newBranchName>${project.version}</newBranchName>
                                </configuration>
                            </execution>
                            -->
                            <execution>
                                <id>generate-codeflowers</id>
                                <goals>
                                    <goal>codeflowers</goal>
                                </goals>
                                <phase>install</phase>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Documentation - Lexakai -->

                    <plugin>
                        <groupId>com.googlecode.maven-download-plugin</groupId>
                        <artifactId>download-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>install-jbpm</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <url>https://repo.maven.apache.org/maven2/com/telenav/lexakai/lexakai-application/${lexakai.version}/lexakai-application-${lexakai.version}.jar</url>
                            <outputDirectory>${lexakai.downloads.folder}</outputDirectory>
                            <overwrite>true</overwrite>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.2.1</version>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>run-lexakai</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>java</executable>
                                    <workingDirectory>${documentation.lexakai.downloads.folder}</workingDirectory>
                                    <arguments>
                                        <argument>-jar</argument>
                                        <argument>${documentation.lexakai.downloads.folder}/lexakai-application-${lexakai.version}.jar</argument>
                                        <argument>-update-readme=true</argument>
                                        <argument>-output-folder=${documentation.lexakai.folder}</argument>
                                        <!--suppress UnresolvedMavenProperty -->
                                        <argument>${env.TELENAV_WORKSPACE}/${repository.name}/</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Signing -->

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Publishing -->

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${maven.nexus.staging.plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <skipLocalStaging>true</skipLocalStaging>
                            <skipNexusStagingDeployMojo>${nexus.deploy.skip}</skipNexusStagingDeployMojo>
                            <autoReleaseAfterClose>${nexus.release}</autoReleaseAfterClose>
                            <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
                        </configuration>
                        <executions>
                            <execution>
                                <id>default-deploy</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>${maven.deploy.plugin.version}</version>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>

    </profiles>

</project>
