<?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</groupId>
    <artifactId>telenav-root-superpom</artifactId>
    <version>1.0.2</version>

    <!--
    The uber-pom of uber-poms.  This is the place ONLY for stuff that
    almost NEVER changes and is safe to have in the configuration for
    EVERY SINGLE PROJECT, both pom and jar.
    -->

    <packaging>pom</packaging>
    <name>telenav-root-superpom</name>
    <description>
        The uber-root telenav superpom, containing global plugin configuration, possibly a few
        rarely changing dependency management elements and NOTHING ELSE.  Anything here must be
        safe to include in the build of EVERY SINGLE PROJECT.
    </description>

    <dependencyManagement>
        <!-- Plugins only here - libraries belong in a child superpom for
        a more specific purpose.  Using dependencyManagement to manage
        plugin version simply buys us the flexibility to use range
        dependencies and similar -->
        <dependencies>
            <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>${maven.shade.plugin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${maven-site-plugin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus-staging-maven-plugin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <!-- Resource Copying -->

        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
        </resources>

        <testResources>
            <testResource>
                <directory>src/test/java</directory>
                <includes>
                    <include>**/*</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
            </testResource>
        </testResources>

        <!-- Plugins -->

        <plugins>

            <!-- Dependencies -->

            <plugin>

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

                    <execution>

                        <id>enforce</id>
                        <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>

            <plugin>

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

                <configuration>

                    <show>public</show>
                    <source>11</source>
                    <detectJavaApiLink>false</detectJavaApiLink>
                    <doclint>none</doclint>
                    <nohelp>true</nohelp>
                    <additionalOptions>
                        -notimestamp --show-module-contents all --show-packages
                        all --show-types private --add-reads cactus.maven.plugin=ALL-UNNAMED
                    </additionalOptions>


                </configuration>
                <executions>
                    <execution>
                        <id>aggregate</id>
                        <phase>site</phase>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                    </execution>
                </executions>

            </plugin>

        </plugins>


        <pluginManagement>
            <plugins>

                <!-- Compiling -->

                <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>

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

                <!-- Building -->

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>

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

                <!-- Testing -->

                <plugin>

                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <excludedGroups>${exclude.test.groups}</excludedGroups>

                        <systemPropertyVariables>
                            <testQuick>${testQuick}</testQuick>
                            <unit.test>true</unit.test>
                        </systemPropertyVariables>
                        <argLine>-Xmx2g</argLine>
                    </configuration>

                </plugin>

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

                <!-- Documentation -->

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

                <plugin>

                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>

                        <show>public</show>
                        <source>17</source>
                        <detectJavaApiLink>false</detectJavaApiLink>
                        <doclint>none</doclint>
                        <nohelp>true</nohelp>
                        <additionalOptions>
                            -notimestamp --show-module-contents all --show-packages
                            all --show-types private
                        </additionalOptions>

                    </configuration>
                    <executions>
                        <execution>
                            <id>aggregate</id>
                            <phase>site</phase>
                            <goals>
                                <goal>aggregate</goal>
                            </goals>
                        </execution>
                    </executions>

                </plugin>

                <!-- Publishing -->

                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                        <skipLocalStaging>true</skipLocalStaging>
                        <skipStaging>${do.not.publish}</skipStaging>
                        <autoReleaseAfterClose>${release.on.close}</autoReleaseAfterClose>
                        <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
                    </configuration>
                </plugin>

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

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

        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>sign-artifacts</id>
            <build>
                <plugins>

                    <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>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>attach-jars</id>
            <build>
                <plugins>

                    <plugin>

                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-source-jar</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>

                    </plugin>

                    <plugin>

                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>

                            <show>protected</show>
                            <source>11</source>
                            <sourcepath>src/main/java</sourcepath>
                            <failOnError>false</failOnError>
                            <detectJavaApiLink>false</detectJavaApiLink>
                            <doclint>none</doclint>
                            <nohelp>true</nohelp>
                            <additionalOptions>
                                -notimestamp --show-module-contents all --show-packages
                                all --show-types private
                            </additionalOptions>
                            <destDir>target/attached-javadocs</destDir>
                            <sourceFileIncludes>
                                <sourceFileInclude>**/*.java</sourceFileInclude>
                            </sourceFileIncludes>

                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadoc-jar</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>

                    </plugin>

                </plugins>

            </build>
        </profile>

        <!-- Mostly automated release profiles -->

        <!-- Pending - These should not be in this pom, but they
            need to live somewhere visible from every project - and
            may need just to be copied to both the project and project family
            superpoms and kept in sync, which is ugly.
            
            The problem is, put this stuff here, and every pom needs an
            update every time there's a new cactus version, and it cascades
            through everything (if we use properties to manage the version,
            anyway).  Unfortunately, you can't omit the plugin version or
            define it in a property that gets redefined in your project.
        -->
        <profile>
            <id>release-phase-0</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <maven.test.skip.exec>true</maven.test.skip.exec>
            </properties>
            <build>
                <plugins>

                    <plugin>
                        <groupId>com.telenav.cactus</groupId>
                        <artifactId>cactus-maven-plugin</artifactId>
                        <version>${cactus.maven.plugin.version}</version>
                        <configuration>
                            <scope>family</scope>
                            <verbose>true</verbose>
                            <includeRoot>true</includeRoot>
                            <tolerateVersionInconsistenciesIn>lexakai</tolerateVersionInconsistenciesIn>
                        </configuration>
                        <executions>
                            <execution>
                                <id>filter-families-from-plugins-1</id>
                                <goals>
                                    <goal>filter-families</goal>
                                </goals>
                                <configuration>
                                    <familiesRequired>true</familiesRequired>
                                    <properties>
                                        cactus.generate.lexakai.skip,
                                        cactus.publish.check.skip,
                                        maven.javadoc.skip</properties>
                                </configuration>
                            </execution>
                            <execution>
                                <id>consistency-check</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <checkDirty>false</checkDirty>
                                    <!-- fixme -->
                                    <checkRemoteModifications>false</checkRemoteModifications>
                                </configuration>
                            </execution>

                            <execution>
                                <id>clone-into-temp</id>
                                <goals>
                                    <goal>clone</goal>
                                </goals>
                                <phase>validate</phase>
                            </execution>
                                                        
                            <execution>
                                <id>print-phase-zero-message</id>
                                <goals>
                                    <goal>print-message</goal>
                                </goals>
                                <phase>install</phase>
                                <configuration>
                                    <onFailure>false</onFailure>
                                    <message>
                                        Your origin URL has been cloned to the directory displayed.
                                        
                                        Change directories to that to proceed with phase-1:
                                        
                                        `mvn \
                                        \t-P release-phase-1 \
                                        \t-Denforcer.skip=true \
                                        \t-Dcactus.expected.branch=develop \
                                        \t-Dcactus.maven.plugin.version="${CACTUS_VERSION}" \
                                        \t-Dcactus.families=${FAMILIES_TO_RELEASE} \
                                        \t-DreleaseBranchPrefix=${RELEASE_BRANCH_PREFIX} \
                                        \t-Dmaven.test.skip.exec=true \
                                        \t\tclean \
                                        \t\tvalidate
                                        `
                                    </message>
                                </configuration>
                            </execution>

                        </executions>
                    </plugin>        
                </plugins>
            </build>
        </profile>
        
        <profile>
            <id>release-phase-1</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <maven.test.skip.exec>true</maven.test.skip.exec>
            </properties>
            <build>
                <plugins>

                    <plugin>
                        <groupId>com.telenav.cactus</groupId>
                        <artifactId>cactus-maven-plugin</artifactId>
                        <version>${cactus.maven.plugin.version}</version>
                        <configuration>
                            <scope>family</scope>
                            <verbose>true</verbose>
                            <includeRoot>true</includeRoot>
                            <tolerateVersionInconsistenciesIn>lexakai</tolerateVersionInconsistenciesIn>
                        </configuration>
                        <executions>

                            <execution>
                                <id>filter-families-from-plugins-1</id>
                                <goals>
                                    <goal>filter-families</goal>
                                </goals>
                                <configuration>
                                    <familiesRequired>true</familiesRequired>
                                    <properties>
                                        cactus.generate.lexakai.skip,
                                        cactus.publish.check.skip,
                                        maven.javadoc.skip</properties>
                                </configuration>
                            </execution>

                            <!-- pulling this out for now -->
                            <!-- 
                            <execution>
                                <id>pull-assets-checkouts</id>
                                <goals>
                                    <goal>update-assets-checkouts</goal>
                                </goals>
                                <phase>initialize</phase>
                                <configuration>
                                    <pull>true</pull>
                                    <commit>true</commit>
                                </configuration>
                            </execution>
                            -->

                            <execution>
                                <id>consistency-check</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <checkDirty>false</checkDirty>
                                    <!-- fixme -->
                                    <checkRemoteModifications>false</checkRemoteModifications>
                                </configuration>
                            </execution>

                            <execution>
                                <id>bump-versions-of-families</id>
                                <goals>
                                    <goal>bump-version</goal>
                                </goals>
                                <configuration>
                                    <scope>family</scope>
                                    <bumpPublished>true</bumpPublished>
                                    <commitChanges>true</commitChanges>
                                    <commitMessage>Prepare for release</commitMessage>
                                    <versionFlavor>to-release</versionFlavor>
                                    <createReleaseBranch>true</createReleaseBranch>
                                </configuration>
                            </execution>

                            <execution>
                                <goals>
                                    <goal>print-message</goal>
                                </goals>
                                <configuration>
                                    <onFailure>false</onFailure>
                                    <message>
                                        Versions have been bumped and family checkouts are now on a new release branch.
                                        Review the changes, and when you're ready, rebuild your
                                        superpoms - e.g.

                                        `mvn -f telenav-superpom/pom.xml install`

                                        and you are ready for phase 2, building documentation:

                                        `mvn -P release-phase-2 clean install \
                                        \t-Dcactus.families=${FAMILIES_TO_RELEASE} \
                                        \torg.apache.maven.plugins:maven-site-plugin:4.0.0-M1:site verify`

                                        to build documentation, after which you can review what was built,
                                        and, if satisfactory, move on to committing it and publishing.
                                    </message>
                                </configuration>
                            </execution>

                        </executions>
                    </plugin>

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

        <profile>
            <id>release-phase-2</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <maven.shade.skip>true</maven.shade.skip>
            </properties>
            <build>
                <plugins>

                    <plugin>
                        <groupId>com.telenav.cactus</groupId>
                        <artifactId>cactus-maven-plugin</artifactId>
                        <version>${cactus.maven.plugin.version}</version>
                        <configuration>
                            <scope>family</scope>
                            <verbose>true</verbose>
                            <includeRoot>true</includeRoot>
                            <tolerateVersionInconsistenciesIn>lexakai</tolerateVersionInconsistenciesIn>
                        </configuration>

                        <executions>

                            <execution>
                                <id>filter-families-from-plugins</id>
                                <goals>
                                    <goal>filter-families</goal>
                                </goals>
                                <configuration>
                                    <familiesRequired>true</familiesRequired>
                                    <properties>
                                        skipIfEmpty,
                                        gpg.skip,
                                        maven.deploy.skip,
                                        do.not.publish,
                                        cactus.codeflowers.skip,
                                        cactus.copy.javadoc.skip,
                                        cactus.lexakai.skip,
                                        cactus.generate.lexakai.skip,
                                        cactus.publish.check.skip,
                                        maven.javadoc.skip,
                                        skipNexusStagingDeployMojo
                                    </properties>
                                </configuration>
                            </execution>
                            
                            <execution>
                                <!-- Generate magic lexakai files from data in the pom  -->
                                <id>generate-lexakai-properties-files</id>
                                <goals>
                                    <goal>lexakai-generate</goal>
                                </goals>
                            </execution>

                            <execution>
                                <id>generate-codeflowers</id>
                                <goals>
                                    <goal>codeflowers</goal>
                                </goals>
                                <phase>install</phase>
                            </execution>

                            <execution>
                                <id>generate-lexakai-docs</id>
                                <goals>
                                    <goal>lexakai</goal>
                                </goals>
                                <phase>install</phase>
                            </execution>

                            <execution>
                                <id>copy-javadoc-to-assets-dir</id>
                                <goals>
                                    <goal>copy-javadoc</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>

                            <execution>
                                <id>copy-agg-javadoc-to-assets-dir</id>
                                <goals>
                                    <goal>copy-aggregated-javadoc</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>

                            <execution>
                                <id>print-phase-two-message</id>
                                <goals>
                                    <goal>print-message</goal>
                                </goals>
                                <phase>install</phase>
                                <configuration>
                                    <onFailure>false</onFailure>
                                    <message>
                                        Documentation has been generated and READMEs have been updated.

                                        REVIEW THE DOCUMENTATION NOW.

                                        When you are happy with the results, run phase 3 to commit the
                                        changes and prepare the release:

                                        `mvn -P release-phase-3 -Dcactus.families=${FAMILIES_TO_RELEASE} \
                                        \tdeploy`

                                    </message>
                                </configuration>
                            </execution>

                        </executions>
                    </plugin>

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

                            <execution>
                                <id>generate-javadoc</id>
                                <goals>
                                    <goal>javadoc-no-fork</goal>
                                </goals>
                                <phase>prepare-package</phase>
                            </execution>

                            <execution>
                                <id>generate-aggregate-javadoc</id>
                                <goals>
                                    <goal>aggregate-no-fork</goal>
                                </goals>
                                <phase>prepare-package</phase>
                            </execution>

                        </executions>
                    </plugin>
                    
                    <!-- Some javadoc won't be (and cannot be if it uses the shade plugin
                    to clobber module-info.class files) rebuilt, so we night to
                    sign NOW in addition to including the plugin in the next phase -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>

                            <execution>
                                <id>sign-artifacts</id>
                                <phase>install</phase>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                                <goals>
                                    <goal>sign</goal>
                                </goals>

                            </execution>
                        </executions>
                    </plugin>
                    

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

        <profile>
            <id>release-phase-3</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <releasePush>false</releasePush>
            </properties>
            <build>
                <plugins>

                    <plugin>
                        <groupId>com.telenav.cactus</groupId>
                        <artifactId>cactus-maven-plugin</artifactId>
                        <version>${cactus.maven.plugin.version}</version>
                        <configuration>
                            <scope>family</scope>
                            <verbose>true</verbose>
                            <includeRoot>true</includeRoot>
                            <tolerateVersionInconsistenciesIn>lexakai</tolerateVersionInconsistenciesIn>
                        </configuration>
                        <executions>

                            <execution>
                                <id>filter-families-from-plugins-3</id>
                                <goals>
                                    <goal>filter-families</goal>
                                </goals>
                                <configuration>
                                    <familiesRequired>true</familiesRequired>
                                    <properties>
                                        skipIfEmpty,
                                        maven.deploy.skip,
                                        cactus.codeflowers.skip,
                                        cactus.copy.javadoc.skip,
                                        cactus.lexakai.skip,
                                        cactus.generate.lexakai.skip,
                                        cactus.publish.check.skip,
                                        maven.javadoc.skip,
                                        do.not.publish,
                                        skipNexusStagingDeployMojo,
                                        gpg.skip
                                    </properties>
                                </configuration>
                            </execution>
                            
                            <execution>
                                <!-- Ensure we don't try to publish a pom that
                                     was already published and is identical to the
                                     published one. -->
                                <id>filter-already-published-identical-poms</id>
                                <goals>
                                    <goal>filter-published</goal>
                                </goals>
                            </execution>

                            <execution>
                                <id>commit-doc-changes</id>
                                <goals>
                                    <goal>commit</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <push>${releasePush}</push>
                                    <scope>all-project-families</scope>
                                    <commitChanges>true</commitChanges>
                                    <includeRoot>true</includeRoot>
                                    <commitMessage>Commit docs for release</commitMessage>
                                </configuration>
                            </execution>

                            <execution>
                                <id>commit-asset-changes</id>
                                <goals>
                                    <goal>commit-assets</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <push>${releasePush}</push>
                                </configuration>
                            </execution>

                            <execution>
                                <id>check-already-published-version</id>
                                <goals>
                                    <goal>check-published</goal>
                                </goals>
                            </execution>

                            <execution>
                                <id>copy-javadoc-to-assets</id>
                                <goals>
                                    <goal>copy-aggregated-javadoc</goal>
                                </goals>
                            </execution>
                            
                            <execution>
                                <id>update-metadata-post-commit</id>
                                <goals>
                                    <goal>build-metadata</goal>
                                </goals>
                            </execution>

                            <execution>
                                <id>print-phase-three-message</id>
                                <goals>
                                    <goal>print-message</goal>
                                </goals>
                                <phase>deploy</phase>
                                <configuration>
                                    <onFailure>false</onFailure>
                                    <message>
                                        Documentation changes have been commited, and
                                        perhaps pushed? (${releasePush})

                                        Artifacts have been uploaded to nexus.  Review, 
                                        and release the repository
                                        if things look right.

                                        The next phase will merge your changes back to the
                                        development branch, and move all released families
                                        onto a new snapshot version.
                                    </message>
                                </configuration>
                            </execution>

                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>generate-javadoc</id>
                                <goals>
                                    <goal>javadoc-no-fork</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>generate-aggregate-javadoc</id>
                                <goals>
                                    <goal>aggregate-no-fork</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>generate-javadoc-jar</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>generate-source-jar</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <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>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <configuration>
                            <skipLocalStaging>true</skipLocalStaging>
                            <skipStaging>${do.not.publish}</skipStaging>
                            <autoReleaseAfterClose>${release.on.close}</autoReleaseAfterClose>
                            <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
                        </configuration>

                        <executions>
                            <execution>
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                            </execution>
                        </executions>

                    </plugin>

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

        <profile>
            <id>release-phase-4</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.telenav.cactus</groupId>
                        <artifactId>cactus-maven-plugin</artifactId>
                        <version>${cactus.maven.plugin.version}</version>
                        <configuration>
                            <scope>family</scope>
                            <verbose>true</verbose>
                            <tolerateVersionInconsistenciesIn>lexakai</tolerateVersionInconsistenciesIn>
                            <push>${releasePush}</push>
                            <commitChanges>true</commitChanges>
                            <includeRoot>true</includeRoot>
                            <commitMessage>Commit docs for release</commitMessage>
                        </configuration>
                        <executions>

                            <execution>
                                <id>filter-families-from-plugins-4</id>
                                <goals>
                                    <goal>filter-families</goal>
                                </goals>
                                <configuration>
                                    <familiesRequired>true</familiesRequired>
                                    <properties>skipIfEmpty,cactus.publish.check.skip,cactus.check.skip</properties>
                                </configuration>
                            </execution>

                            <execution>
                                <id>merge-release-into-develop</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>merge</goal>
                                </goals>
                                <configuration>
                                    <alsoMergeInto>release/current</alsoMergeInto>
                                    <tag>true</tag>
                                    <includeRoot>true</includeRoot>
                                </configuration>
                            </execution>

                            <execution>
                                <id>move-to-new-snapshot-version</id>
                                <goals>
                                    <goal>bump-version</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <commitChanges>true</commitChanges>
                                    <scope>family</scope>
                                    <includeRoot>true</includeRoot>
                                    <versionFlavor>to-snapshot</versionFlavor>
                                    <updateDocs>false</updateDocs>
                                    <superpomBumpPolicy>BUMP_ACQUIRING_NEW_FAMILY_FLAVOR</superpomBumpPolicy>
                                </configuration>
                            </execution>

                            <execution>
                                <id>commit-new-snapshots</id>
                                <goals>
                                    <goal>commit</goal>
                                </goals>
                                <phase>generate-resources</phase>
                                <configuration>
                                    <commitMessage>Update to new snapshot version</commitMessage>
                                    <scope>all</scope>
                                    <includeRoot>true</includeRoot>
                                </configuration>
                            </execution>

                            <execution>
                                <id>push-new-snapshots</id>
                                <goals>
                                    <goal>push</goal>
                                </goals>
                                <phase>process-resources</phase>
                                <configuration>
                                    <pushAll>true</pushAll>
                                </configuration>
                            </execution>

                            <execution>
                                <id>phase-4-message</id>
                                <goals>
                                    <goal>print-message</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <onFailure>false</onFailure>
                                    <message>
                                        You are now back on the development branch, with 
                                        new snapshot versions of everything that was published
                                        locally and pushed (${releasePush}) to the git server.

                                        Congratulations!  You released ${cactus.families}
                                        in ${project.basedir}!
                                    </message>
                                </configuration>
                            </execution>

                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

    <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>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <!-- Publishing -->

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>

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

    <!-- Source Code -->

    <scm>
        <connection>scm:git:https://Telenav/telenav-build.git</connection>
        <developerConnection>scm:git:https://Telenav/telenav-build.git</developerConnection>
        <url>https://Telenav/kivakit.git</url>
    </scm>

    <!-- Project -->

    <url>https://www.telenav.com/</url>

    <inceptionYear>2011</inceptionYear>

    <organization>
        <name>Telenav</name>
        <url>https://www.telenav.com</url>
    </organization>

    <!-- 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>

    <!-- 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>

    <properties>

        <!-- Build -->

        <java.version>11</java.version>
        <maven.version>3.8.5</maven.version>
        <maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
        <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
        <maven-javadoc-plugin.version>3.4.0</maven-javadoc-plugin.version>
        <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
        <maven-shade-plugin.version>3.3.0</maven-shade-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-exec-plugin.version>3.0.0</maven-exec-plugin.version>
        <maven-protobuf-plugin.version>0.6.1</maven-protobuf-plugin.version>
        <maven-release-plugin.version>3.0.0-M6</maven-release-plugin.version>
        <maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version>
        <maven-os-plugin.version>1.6.1</maven-os-plugin.version>
        <maven.plugin.plugin.version>3.6.4</maven.plugin.plugin.version>
        <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>

        <!-- We want to specify a version of the site plugin that won't
        crash hard, which the 3.3 default does - but we don't actually
        want it to do anything, so our own plugins can use the
        site target without causing a bunch of pointless work to run. -->
        <maven.site.skip>true</maven.site.skip>
        <maven-site-plugin.version>4.0.0-M1</maven-site-plugin.version>

        <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
        <moditect-maven-plugin.version>1.0.0.RC1</moditect-maven-plugin.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- NetBeans code formatting global options for all Java projects -->

        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.enable-indent>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.enable-indent>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.moduleDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.moduleDeclBracePlacement>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.redundantIfBraces>LEAVE_ALONE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.redundantIfBraces>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>NEW_LINE</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.specialElseIf>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.specialElseIf>
        <org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap>none</org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap>
        <org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>4</org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>
        <org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab>4</org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab>
        <org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>4</org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>
        <org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>120</org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>
        <org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>true</org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>
        <org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width>4</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapExtendsImplementsList>WRAP_IF_LONG</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapExtendsImplementsList>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapAnnotationArgs>WRAP_IF_LONG</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapAnnotationArgs>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapThrowsKeyword>WRAP_IF_LONG</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapThrowsKeyword>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapTernaryOps>WRAP_ALWAYS</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapTernaryOps>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapAfterDotInChainedMethodCalls>false</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapAfterDotInChainedMethodCalls>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapMethodCallArgs>WRAP_IF_LONG</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapMethodCallArgs>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapExtendsImplementsKeyword>WRAP_IF_LONG</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapExtendsImplementsKeyword>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapEnumConstants>WRAP_ALWAYS</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapEnumConstants>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapMethodParams>WRAP_IF_LONG</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapMethodParams>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapChainedMethodCalls>WRAP_IF_LONG</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapChainedMethodCalls>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-line-wrap>none</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-line-wrap>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab>4</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapArrayInit>WRAP_IF_LONG</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapArrayInit>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size>4</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapDisjunctiveCatchTypes>WRAP_IF_LONG</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapDisjunctiveCatchTypes>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-limit-width>80</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-limit-width>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesAfterClassHeader>0</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesAfterClassHeader>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineImplements>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineImplements>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTernaryOp>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTernaryOp>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder>*;static *</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateStaticImports>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateStaticImports>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.countForUsingStaticStarImport>5</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.countForUsingStaticStarImport>
        <org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.allowConvertToStaticStarImport>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.allowConvertToStaticStarImport>
    </properties>

</project>
