<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.github.stevecrox</groupId>
    <artifactId>maven-parent</artifactId>
    <version>0.0.8</version>
    <packaging>pom</packaging>

    <name>Maven Parent</name>
    <description>SUPER POM to simplify development of Maven based projects.</description>
    <url>https://${project.site.repository}/${project.groupId}/${project.artifactId}/</url>
    <inceptionYear>2022</inceptionYear>

    <scm>
        <connection>scm:git:https://github.com/stevecrox/maven-parent.git</connection>
        <developerConnection>scm:git:https://github.com/stevecrox/maven-parent.git</developerConnection>
        <url>https://github.com/stevecrox/maven-parent</url>
        <tag>v0.0.8</tag>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/stevecrox/maven-parent/issues</url>
    </issueManagement>

    <distributionManagement>
        <snapshotRepository>
            <id>snapshots</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>main</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <site>
            <id>site</id>
            <url>${project.scmpublish.pubScmUrl}</url>
        </site>
    </distributionManagement>

    <developers>
        <developer>
            <name>Stephen Crocker</name>
            <email>stevecrox AT hotmail DOT com DOT br</email>
        </developer>
    </developers>

    <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>
        <!-- Compiler settings, lets you tweak what JDK you are using as needed. -->
        <project.build.sourceVersion>1.8</project.build.sourceVersion>
        <project.build.targetVersion>1.8</project.build.targetVersion>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.targetEncoding>ISO-8859-1</project.build.targetEncoding>
        <!-- Details for uploading sites into Repository. -->
        <project.site.repository>stevecrox.github.io</project.site.repository>
        <project.scmpublish.pubScmUrl>scm:git:https://github.com//stevecrox/${project.site.repository}</project.scmpublish.pubScmUrl>
        <project.staging.directory>${project.build.directory}/staging</project.staging.directory>
        <!-- Apache Maven Build Plugin Versions. -->
        <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
        <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
        <!-- Apache Maven Test Plugin Versions. -->
        <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
        <maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>2.22.0</maven-failsafe-plugin.version>
        <!-- Apache Maven Release Plugin Versions. -->
        <checksum-maven-plugin.version>1.11</checksum-maven-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <releaseVersion />
        <!-- Apache Maven Reporting Plugin Versions. -->
        <maven-site-plugin.version>3.12.0</maven-site-plugin.version>
        <maven-project-info-reports-plugin.version>3.3.0</maven-project-info-reports-plugin.version>
        <maven-scm-publish-plugin.version>3.1.0</maven-scm-publish-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-changelog-plugin.version>2.3</maven-changelog-plugin.version>
        <maven-javadoc-plugin.version>3.4.0</maven-javadoc-plugin.version>
        <maven-jxr-plugin.version>3.2.0</maven-jxr-plugin.version>
        <maven-surefire-report-plugin.version>2.22.0</maven-surefire-report-plugin.version>
        <taglist-maven-plugin.version>3.0.0</taglist-maven-plugin.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <!-- Apache Maven Build Plugin Definitions. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${project.build.sourceVersion}</source>
                        <release>${project.build.sourceVersion}</release>
                        <target>${project.build.targetVersion}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <!-- Added so CI's like Jenkins can scan the console for warnings. -->
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                        <!-- Added to stop the compiler from including build artifacts/project data. -->
                        <excludes>
                            <exclude>**/bin/**/*.*</exclude>
                            <exclude>**/.settings/**/*.*</exclude>
                            <exclude>**/target/**/*.*</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                    <configuration>
                        <attach>true</attach>
                        <includePom>true</includePom>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <serialwarn>true</serialwarn>
                        <source>${project.build.sourceVersion}</source>
                        <release>${project.build.sourceVersion}</release>
                    </configuration>
                </plugin>
                <!-- Apache Maven Test Plugin Definitions. -->
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <excludes>
                            <exclude>**/*Integration*</exclude>
                            <exclude>**/IT*</exclude>
                            <exclude>**/*IT</exclude>
                        </excludes>
                        <includes>
                            <include>**/*Test*</include>
                            <include>**/*Test*</include>
                        </includes>
                        <reuseForks>false</reuseForks>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <excludes>
                            <exclude>**/*Test*</exclude>
                            <exclude>**/*Test*</exclude>
                        </excludes>
                        <includes>
                            <include>**/*Integration*</include>
                            <include>**/IT*</include>
                            <include>**/*IT</include>
                        </includes>
                        <reuseForks>false</reuseForks>
                    </configuration>
                </plugin>
                <!-- Apache Maven Release Plugin Definitions. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <configuration>
                        <gpgArguments>
                            <arg>--pinentry-mode</arg>
                            <arg>loopback</arg>
                        </gpgArguments>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>net.nicoulaj.maven.plugins</groupId>
                    <artifactId>checksum-maven-plugin</artifactId>
                    <version>${checksum-maven-plugin.version}</version>
                    <configuration>
                        <algorithms>
                            <algorithm>MD5</algorithm>
                            <algorithm>SHA-512</algorithm>
                        </algorithms>
                        <attachChecksums>true</attachChecksums>
                        <includeClassifiers>source-release</includeClassifiers>
                        <excludeMainArtifact>false</excludeMainArtifact>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <tagNameFormat>v${releaseVersion}</tagNameFormat>
                    </configuration>
                </plugin>
                <!-- Apache Maven Reporting Plugin Definitions. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin.version}</version>
                    <configuration>
                        <topSiteURL>${project.scmpublish.pubScmUrl}</topSiteURL>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-descriptor</id>
                            <goals>
                                <goal>attach-descriptor</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-scm-publish-plugin</artifactId>
                    <version>${maven-scm-publish-plugin.version}</version>
                    <configuration>
                        <scmBranch>main</scmBranch>
                        <serverId>site</serverId>
                        <content>${project.staging.directory}</content>
                        <pubScmUrl>${project.scmpublish.pubScmUrl}</pubScmUrl>
                        <subDirectory>${project.groupId}/${project.artifactId}</subDirectory>
                    </configuration>
                </plugin>
                <!-- Maven Reporting Plugin. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${maven-project-info-reports-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-changelog-plugin</artifactId>
                    <version>${maven-changelog-plugin.version}</version>
                    <configuration>
                        <displayFileRevDetailUrl>${project.scm.url}/tree/master/%FILE%</displayFileRevDetailUrl>
                        <displayChangeSetDetailUrl>${project.scm.url}/commit</displayChangeSetDetailUrl>
                        <headingDateFormat>MM-dd-yyyy</headingDateFormat>
                        <outputEncoding>${project.build.sourceEncoding}</outputEncoding>
                        <type>range</type>
                        <range>30</range>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-report-plugin</artifactId>
                    <version>${maven-surefire-report-plugin.version}</version>
                    <configuration>
                        <aggregate>true</aggregate>
                        <alwaysGenerateSurefireReport>true</alwaysGenerateSurefireReport>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>taglist-maven-plugin</artifactId>
                    <version>${taglist-maven-plugin.version}</version>
                    <configuration>
                        <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
                        <sourceFileLocale>en</sourceFileLocale>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jxr-plugin</artifactId>
                    <version>${maven-jxr-plugin.version}</version>
                    <configuration>
                        <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
                        <outputEncoding>${project.build.targetEncoding}</outputEncoding>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-changelog-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>taglist-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>documentation</id>
            <activation>
                <file>
                    <exists>src/main/java</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.nicoulaj.maven.plugins</groupId>
                        <artifactId>checksum-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>source-release-checksum</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>artifacts</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
