<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2024 Craig Motlin
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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>
    <packaging>pom</packaging>

    <groupId>io.liftwizard</groupId>
    <artifactId>liftwizard-minimal-parent</artifactId>
    <version>2.1.32</version>
    <name>Liftwizard Maven Parent (minimal)</name>

    <description>Liftwizard is a collection of bundles and add-ons for Dropwizard, the Java framework for writing web services.</description>

    <url>https://github.com/liftwizard/liftwizard</url>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/liftwizard/liftwizard/issues</url>
    </issueManagement>

    <ciManagement>
        <system>GitHub</system>
        <url>https://github.com/liftwizard/liftwizard/actions</url>
    </ciManagement>

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

    <scm>
        <url>https://github.com/liftwizard/liftwizard</url>
        <connection>scm:git:https://github.com/liftwizard/liftwizard.git</connection>
        <developerConnection>scm:git:https@github.com:liftwizard/liftwizard.git</developerConnection>
        <tag>2.1.32</tag>
    </scm>

    <inceptionYear>2020</inceptionYear>

    <developers>
        <developer>
            <name>Craig Motlin</name>
            <email>cmotlin@gmail.com</email>
            <url>https://github.com/motlin</url>
            <id>motlin</id>
        </developer>
    </developers>

    <properties>

        <!-- https://maven.apache.org/plugins/maven-resources-plugin/examples/encoding.html#specifying-a-character-encoding-scheme -->
        <!-- Configure a sourceEncoding for maven-resources-plugin -->
        <!-- Avoids errors of the form:  [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! -->
        <!-- Unnecessary starting with maven 4 -->
        <!--region sourceEncoding-->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <!--endregion sourceEncoding-->

        <!-- https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-do-i-configure-my-maven-build -->
        <!-- Enable Reproducible Builds mode for plugins -->
        <!--region outputTimestamp-->
        <project.build.outputTimestamp>2025-06-18T03:05:29Z</project.build.outputTimestamp>
        <!--endregion outputTimestamp-->

        <!-- This is necessary when using @argLine in maven-surefire-plugin, and maven profiles that may or may not initialize argLine -->
        <argLine />
    </properties>

    <build>
        <!-- The default goal or phase to execute when none is specified for the project. -->
        <!-- verify is a better choice than install in the presence of concurrent builds that may write to .m2/repository simultaneously -->
        <!--region defaultGoal-->
        <defaultGoal>verify</defaultGoal>
        <!--endregion defaultGoal-->

        <plugins>
            <!--region Plugins which are bound and enabled by default-->

            <!-- These plugins are bound and enabled by default -->
            <!-- But the default version of these plugins changes with the version of maven running -->

            <!--region Phase 0: clean-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.4.1</version>
            </plugin>
            <!--endregion Phase 0: clean-->

            <!--region Phase 6: process-resources-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.3.1</version>
            </plugin>
            <!--endregion Phase 6: process-resources-->

            <!--region Phase 7: compile-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.14.0</version>
                <configuration>
                    <!-- https://maven.apache.org/plugins-archives/maven-compiler-plugin-3.8.1/compile-mojo.html#parameters -->
                    <!-- https://stackoverflow.com/a/44075684/ -->
                    <!-- https://docs.oracle.com/javase/9/tools/javac.htm -->
                    <!-- Generates metadata for reflection on method parameters. Stores formal parameter names of constructors and methods in the generated class file so that the method java.lang.reflect.Executable.getParameters from the Reflection API can retrieve them. -->
                    <parameters>true</parameters>
                </configuration>
            </plugin>
            <!--endregion Phase 7: compile-->

            <!--region Phase 15: test-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.2</version>
                <!-- In maven 3.9.6 and 4.x, maven is able to auto-detect JUnit and these dependencies are not required -->
                <!-- In maven 3.9.5, there is an internal exception inside surefire without these declared -->
                <!-- Even with newer versions of maven, it is advantageous to keep these declarations -->
                <!-- Without them, maven may only run JUnit 5 tests, in a project with both JUnit 4 and 5 -->
                <dependencies>
                    <dependency>
                        <groupId>org.junit.jupiter</groupId>
                        <artifactId>junit-jupiter-engine</artifactId>
                        <version>5.10.3</version>
                    </dependency>
                    <dependency>
                        <groupId>org.junit.platform</groupId>
                        <artifactId>junit-platform-engine</artifactId>
                        <version>1.10.3</version>
                    </dependency>
                    <dependency>
                        <groupId>org.junit.vintage</groupId>
                        <artifactId>junit-vintage-engine</artifactId>
                        <version>5.10.3</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <!-- The compiler in the server VM now provides correct stack backtraces for all "cold" built-in exceptions. For performance purposes, when such an exception is thrown a few times, the method may be recompiled. After recompilation, the compiler may choose a faster tactic using preallocated exceptions that do not provide a stack trace. To disable completely the use of preallocated exceptions, use this new flag: -XX:-OmitStackTraceInFastThrow. -->
                    <!-- https://stackoverflow.com/a/4659279/ -->
                    <!-- The compiler in the server VM now provides correct stack backtraces for all "cold" built-in exceptions. For performance purposes, when such an exception is thrown a few times, the method may be recompiled. After recompilation, the compiler may choose a faster tactic using preallocated exceptions that do not provide a stack trace. To disable completely the use of preallocated exceptions, use this new flag: -XX:-OmitStackTraceInFastThrow. -->
                    <!-- https://stackoverflow.com/a/4659279/ -->
                    <!-- Add argLine to allow the Jacoco plugin to append without overriding the setting -->
                    <!-- https://stackoverflow.com/a/39818768/ -->
                    <argLine>-XX:-OmitStackTraceInFastThrow @{argLine}</argLine>
                    <runOrder>random</runOrder>
                    <trimStackTrace>false</trimStackTrace>
                    <systemPropertyVariables>
                        <!-- Only relevant when using AssertJ. Disables org.assertj.core.util.Throwables.removeAssertJRelatedElementsFromStackTrace() -->
                        <assertj.remove.assertj.related.elements.from.stack.trace>false</assertj.remove.assertj.related.elements.from.stack.trace>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <!--endregion Phase 15: test-->

            <!--region Phase 17: package-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.4.2</version>
            </plugin>
            <!--endregion Phase 17: package-->

            <!--region Phase 22: install-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>3.1.4</version>
            </plugin>
            <!--endregion Phase 22: install-->

            <!--region Phase 23: deploy-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.4</version>
            </plugin>
            <!--endregion Phase 23: deploy-->
            <!--endregion Plugins which are bound and enabled by default-->

            <!--region No phase-->

            <!--mvn versions:display-dependency-updates-->
            <!--mvn versions:display-plugin-updates-->
            <!--mvn versions:display-property-updates-->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.18.0</version>
                <configuration>
                    <!-- Don't create pom.xml.versionsBackup files -->
                    <generateBackupPoms>false</generateBackupPoms>
                    <!-- Process all modules in a multi-module build, even aggregator modules without a parent-child relationship -->
                    <!-- https://stackoverflow.com/a/49246337/23572 -->
                    <processAllModules>true</processAllModules>
                </configuration>
            </plugin>

            <!--mvn dependency:tree-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.8.1</version>
            </plugin>

            <!--mvn buildplan:list-->
            <!--mvn buildplan:list-phase-->
            <!--mvn buildplan:list-plugin-->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildplan-maven-plugin</artifactId>
                <version>2.2.2</version>
                <configuration>
                    <!-- Default value is: deploy -->
                    <tasks>
                        <task>clean</task>
                        <task>deploy</task>
                    </tasks>
                    <!-- print all phases, even if no mapping to an execution is available -->
                    <showAllPhases>true</showAllPhases>
                </configuration>
            </plugin>

            <!--mvn rewrite:run-->
            <!--mvn rewrite:dryRun-->
            <plugin>
                <groupId>org.openrewrite.maven</groupId>
                <artifactId>rewrite-maven-plugin</artifactId>
                <version>6.3.0</version>
                <dependencies>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-static-analysis</artifactId>
                        <version>2.4.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-migrate-java</artifactId>
                        <version>3.4.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-testing-frameworks</artifactId>
                        <version>3.4.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-logging-frameworks</artifactId>
                        <version>3.4.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-apache</artifactId>
                        <version>2.4.0</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!--mvnw wrapper:wrapper -Dmaven=4.0.0-alpha-7-->
            <plugin>
                <artifactId>maven-wrapper-plugin</artifactId>
                <version>3.3.2</version>
            </plugin>

            <!--mvn clean release:clean release:prepare -DdevelopmentVersion=1.2.3-SNAPSHOT-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <!-- Default value is: invoker -->
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <!-- Automatically assign submodules the parent version -->
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <!-- Do not `git push` changes to the upstream repository -->
                    <pushChanges>false</pushChanges>
                    <!-- Format to use when generating the tag name -->
                    <!-- Default value is: @{project.artifactId}-@{project.version} -->
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <!--endregion No phase-->

            <!--region Phase 1: validate-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.5.0</version>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>extra-enforcer-rules</artifactId>
                        <version>1.9.0</version>
                    </dependency>
                </dependencies>
            </plugin>
            <!--endregion Phase 1: validate-->

        </plugins>

    </build>

    <profiles>
        <profile>
            <id>maven-central-deploy</id>

            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <name>Sonatype Nexus Snapshots</name>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>

                <repository>
                    <id>ossrh</id>
                    <name>Nexus Release Repository</name>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>

            <build>
                <plugins>
                    <!--region Phase 21: verify-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.7</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- Prevent `gpg` from using pinentry programs -->
                                    <!-- https://github.com/samuelmeuli/action-maven-publish/issues/1 -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!--endregion Phase 21: verify-->

                    <!--region Phase 23: deploy-->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.7.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                            <autoDropAfterRelease>true</autoDropAfterRelease>
                            <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
                            <keepStagingRepositoryOnFailure>true</keepStagingRepositoryOnFailure>
                            <skipLocalStaging>true</skipLocalStaging>
                        </configuration>
                    </plugin>
                    <!--endregion Phase 23: deploy-->
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
