<!--
 ************************************************************************
 * Copyright (c) Crater Dog Technologies(TM).  All Rights Reserved.     *
 ************************************************************************
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.        *
 *                                                                      *
 * This code is free software; you can redistribute it and/or modify it *
 * under the terms of The MIT License (MIT), as published by the Open   *
 * Source Initiative. (See https://opensource.org/licenses/MIT)          *
 ************************************************************************
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <organization>
        <name>Crater Dog Technologies(TM)</name>
        <url>https://craterdog.com</url>
    </organization>

    <name>Crater Dog Root Parent POM</name>
    <description>The root parent POM for all other POM files.</description>
    <url>https://github.com/craterdog/maven-parent-poms/wiki</url>

    <groupId>com.craterdog.maven-parent-poms</groupId>
    <artifactId>root</artifactId>
    <version>3.22</version>
    <packaging>pom</packaging>

    <licenses>
        <license>
            <name>The MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Derk Norton</name>
            <email>derk.norton@gmail.com</email>
            <organization>Crater Dog Technologies(TM)</organization>
            <organizationUrl>https://craterdog.com</organizationUrl>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven-scm-plugin-version>1.13.0</maven-scm-plugin-version>
        <maven-staging-plugin-version>1.6.13</maven-staging-plugin-version>
        <maven-release-plugin-version>2.5.3</maven-release-plugin-version>
        <maven-gpg-plugin-version>1.6</maven-gpg-plugin-version>
        <maven-deploy-plugin-version>2.8.2</maven-deploy-plugin-version>
    </properties>

    <distributionManagement>
        <!-- these properties should be defined in your settings.xml file -->
        <snapshotRepository>
            <id>${repository-id}</id>
            <url>${repository-snapshot-url}</url>
        </snapshotRepository>
        <repository>
            <id>${repository-id}</id>
            <url>${repository-release-url}</url>
        </repository>
    </distributionManagement>

    <!--
    This defines the plugins needed for the default maven release and deploy mechanism.  It
    can be overridden to use the nexus staging plugin by specifying "-P verify,nexus" on the
    commandline.
    -->
    <build>
        <plugins>
            <!--
            This plugin is used by maven to interact with your source code management
            system.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>${maven-scm-plugin-version}</version>
                <configuration>
                    <connectionType>connection</connectionType>
                </configuration>
            </plugin>
            <!--
            This plugin is used by maven to generate a new release of the artifacts for
            this project.  It only generates the minimum needed artifacts, no sources
            or javadocs are generated.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin-version}</version>
                <configuration>
                    <!-- handle multi-module projects -->
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <!-- disable adding sources and javadocs in default case -->
                    <useReleaseProfile>false</useReleaseProfile>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <!--
            This plugin is used by maven to deploy the generated artifacts if it has
            not been overridden by the nexus staging plugin (see below).
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin-version}</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!--
        This profile should be used when releasing a maven project using the nexus
        staging plugin instead of the default deployment plugin.  NOTE: you must setup
        a signing key to release artifacts.  Directions on how to set this up and other
        important steps is documented here:
        https://github.com/craterdog/maven-parent-poms/wiki/Jump-Starting-an-Open-Source-Project#creating-a-sonatype-account
        This profile can be activated by including "-P nexus" on the commandline.
        -->
        <profile>
            <id>nexus</id>
            <build>
                <plugins>
                    <!--
                    This plugin is used during deployment to sign all artifacts prior
                    to transfering them to the central repository.
                    -->
                    <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>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!--
                    This plugin replaces the default maven deployment plugin for transfering the
                    artifacts to a nexus compatible repository like https://oss.sonatype.org/.
                    -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${maven-staging-plugin-version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <!-- these properties should be defined in your settings.xml file -->
                            <serverId>${repository-id}</serverId>
                            <nexusUrl>${repository-url}</nexusUrl>
                            <stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <scm>
        <connection>scm:git:git@github.com:craterdog/maven-parent-poms.git</connection>
        <developerConnection>scm:git:git@github.com:craterdog/maven-parent-poms.git</developerConnection>
        <url>https://github.com/craterdog/maven-parent-poms</url>
        <tag>aggregator-3.22</tag>
    </scm>

</project>
