<?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>com.mikemybytes</groupId>
    <artifactId>junit5-formatted-source-parent</artifactId>
    <packaging>pom</packaging>
    <version>1.0.0</version>

    <name>JUnit 5 FormattedSource (parent)</name>
    <description>Parent project for all JUnit 5 FormattedSource library modules</description>
    <url>${github.project-url}</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://github.com/mikemybytes/junit5-formatted-source/blob/main/LICENSE.md</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Mike Kowalski</name>
            <email>mike [at] mikemybytes.com</email>
            <organization>mikemybytes</organization>
            <organizationUrl>https://mikemybytes.com/</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:mikemybytes/junit5-formatted-source.git</connection>
        <developerConnection>scm:git:ssh://github.com:mikemybytes/junit5-formatted-source.git</developerConnection>
        <tag>1.0.0</tag>
        <url>https://github.com/mikemybytes/junit5-formatted-source</url>
    </scm>

    <modules>
        <module>junit5-formatted-source</module>
        <module>junit5-formatted-source-tests</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- This is the minimum (oldest) JUnit 5 version expected to work with this library -->
        <junit.jupiter.version>5.8.0</junit.jupiter.version>

        <assertj.version>3.24.2</assertj.version>

        <!-- Maven plugins -->
        <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
        <maven-install-plugin.version>3.1.1</maven-install-plugin.version>
        <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-site-plugin.version>3.12.1</maven-site-plugin.version>
        <maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
        <maven-project-info-reports-plugin>3.4.3</maven-project-info-reports-plugin>
        <maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version>
        <maven-versions-plugin.version>2.15.0</maven-versions-plugin.version>
        <maven-release-plugin.version>3.0.0</maven-release-plugin.version>
        <maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
        <jreleaser-maven-plugin.version>1.6.0</jreleaser-maven-plugin.version>
        <maven-help-plugin.version>3.4.0</maven-help-plugin.version>
        <maven-enforcer-plugin.version>3.3.0</maven-enforcer-plugin.version>

        <maven-central.url>https://s01.oss.sonatype.org/service/local</maven-central.url>

        <github.project-url>https://github.com/mikemybytes/junit5-formatted-source</github.project-url>
        <github.project-name>junit5-formatted-source</github.project-name>
        <github.owner>mikemybytes</github.owner>

        <!-- Enforcer configuration -->
        <enforcer-java-version>(17,)</enforcer-java-version>
        <enforcer-maven-version>(3.8.1,)</enforcer-maven-version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                </plugin>
                <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-project-info-reports-plugin</artifactId>
                    <version>${maven-project-info-reports-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${maven-versions-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <releaseProfiles>release</releaseProfiles>
                        <tagNameFormat>@{project.version}</tagNameFormat>
                        <goals>deploy</goals>
                        <pushChanges>false</pushChanges>
                        <localCheckout>true</localCheckout>
                        <scmCommentPrefix>chore: [maven-release-plugin]</scmCommentPrefix>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-help-plugin</artifactId>
                    <version>${maven-help-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven-enforcer-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.jreleaser</groupId>
                <artifactId>jreleaser-maven-plugin</artifactId>
                <version>${jreleaser-maven-plugin.version}</version>
                <inherited>false</inherited>
                <configuration>
                    <jreleaser>
                        <project>
                            <name>junit5-formatted-source</name>
                            <license>MIT</license>
                            <copyright>mikemybytes</copyright>
                        </project>
                        <signing>
                            <active>ALWAYS</active>
                            <mode>FILE</mode>
                            <armored>true</armored>
                        </signing>
                        <deploy>
                            <maven>
                                <nexus2>
                                    <maven-central>
                                        <active>ALWAYS</active>
                                        <url>${maven-central.url}</url>
                                        <closeRepository>true</closeRepository>
                                        <releaseRepository>true</releaseRepository>
                                        <stagingRepositories>target/staging-deploy</stagingRepositories>
                                    </maven-central>
                                </nexus2>
                            </maven>
                        </deploy>
                        <release>
                            <github>
                                <owner>${github.owner}</owner>
                                <name>${github.project-name}</name>
                                <username>${github.owner}</username>
                                <branch>main</branch>
                                <skipTag>true</skipTag>
                                <tagName>{{projectVersion}}</tagName>
                                <releaseName>{{projectVersion}}</releaseName>
                                <changelog>
                                    <preset>conventional-commits</preset>
                                    <formatted>ALWAYS</formatted>
                                    <contentTemplate>etc/jreleaser/changelog.md.tpl</contentTemplate>
                                    <links>true</links>
                                    <contributors>
                                        <format>- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}</format>
                                    </contributors>
                                    <labelers>
                                        <labeler>
                                            <title>[maven-release-plugin]</title>
                                            <label>maven-release-plugin</label>
                                        </labeler>
                                        <labeler>
                                            <title>[release]</title>
                                            <label>release</label>
                                        </labeler>
                                    </labelers>
                                    <excludeLabels>maven-release-plugin,release</excludeLabels>
                                </changelog>
                            </github>
                        </release>
                    </jreleaser>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>${enforcer-java-version}</version>
                                </requireJavaVersion>
                                <requireMavenVersion>
                                    <version>${enforcer-maven-version}</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <!-- This is the only dependency expected to "leak" outside as a transitive one -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit.jupiter.version}</version>
            </dependency>

            <!-- Dependencies below should be for internal usage only (non-transitive) -->
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

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

</project>