<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2022 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">
    <groupId>io.liftwizard</groupId>
    <artifactId>liftwizard-parent-build</artifactId>
    <version>2.1.6</version>
    <modelVersion>4.0.0</modelVersion>

    <packaging>pom</packaging>
    <name>Liftwizard Parent Build</name>

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

        <project.build.outputTimestamp>2024-02-18T19:54:35Z</project.build.outputTimestamp>

        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <maven.compiler.release>17</maven.compiler.release>
        <maven.compiler.parameters>true</maven.compiler.parameters>
    </properties>

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

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

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

    <ciManagement>
        <system>CircleCI</system>
        <url>https://app.circleci.com/pipelines/github/motlin/liftwizard</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/motlin/liftwizard</url>
        <connection>scm:git:https://github.com/motlin/liftwizard.git</connection>
        <developerConnection>scm:git:https@github.com:motlin/liftwizard.git</developerConnection>
      <tag>2.1.6</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>

    <build>
        <defaultGoal>clean install</defaultGoal>

        <plugins>

            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>

            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>de.qaware.maven</groupId>
                <artifactId>go-offline-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>com.github.ferstl</groupId>
                <artifactId>depgraph-maven-plugin</artifactId>
            </plugin>

        </plugins>

        <pluginManagement>
            <plugins>

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

                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.6.0</version>
                </plugin>

                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.3.2</version>
                </plugin>

                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.12.1</version>
                    <configuration>
                        <!-- 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>
                        <useIncrementalCompilation>false</useIncrementalCompilation>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>com.google.auto.service</groupId>
                                <artifactId>auto-service</artifactId>
                                <version>1.0.1</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.6.1</version>
                    <executions>

                        <execution>
                            <id>analyze</id>
                            <goals>
                                <goal>analyze-only</goal>
                            </goals>
                            <configuration>
                                <failOnWarning>false</failOnWarning>
                                <!-- Workaround for bug in maven-dependency-plugin tracked in https://issues.apache.org/jira/browse/MDEP-791 -->
                                <!-- Version 3.1.2 was the last version with a working algorithm. Version 3.2.0 and 3.6.1 support Java 17. -->
                                <ignoredNonTestScopedDependencies>
                                    <ignoredNonTestScopedDependency>*</ignoredNonTestScopedDependency>
                                </ignoredNonTestScopedDependencies>
                            </configuration>
                        </execution>

                    </executions>
                </plugin>

                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>

                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>

                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.3.0</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>3.11.0</version>
                    <executions>
                        <execution>
                            <id>mojo-descriptor</id>
                            <goals>
                                <goal>descriptor</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>help-goal</id>
                            <goals>
                                <goal>helpmojo</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.1</version>
                    <configuration>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <pushChanges>false</pushChanges>
                        <tagNameFormat>@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>

                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.12.1</version>
                </plugin>

                <plugin>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.4.1</version>
                    <executions>
                        <execution>
                            <id>enforce</id>
                            <configuration>
                                <rules>
                                    <DependencyConvergence />
                                    <requireJavaVersion>
                                        <version>1.8.0</version>
                                    </requireJavaVersion>
                                    <requireMavenVersion>
                                        <version>3.6.3</version>
                                    </requireMavenVersion>
                                    <bannedDependencies>
                                        <excludes>
                                            <exclude>commons-logging-api</exclude>
                                            <exclude>commons-logging</exclude>
                                            <exclude>org.apache.logging.log4j:log4j</exclude>
                                            <exclude>org.slf4j:slf4j-simple</exclude>
                                            <exclude>org.slf4j:slf4j-log4j12</exclude>
                                            <exclude>org.slf4j:slf4j-jdk14</exclude>
                                            <exclude>org.slf4j:nop</exclude>
                                            <exclude>org.slf4j:jcl</exclude>
                                        </excludes>
                                    </bannedDependencies>
                                    <banDuplicatePomDependencyVersions />
                                </rules>
                            </configuration>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>2.16.2</version>
                    <configuration>
                        <processAllModules>true</processAllModules>
                        <generateBackupPoms>false</generateBackupPoms>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.2.5</version>
                    <configuration>
                        <includes>
                            <include>**/*Test.java</include>
                        </includes>
                        <argLine>-XX:-OmitStackTraceInFastThrow -Xms1024m -Xmx2048m --illegal-access=permit</argLine>
                        <runOrder>random</runOrder>
                        <trimStackTrace>false</trimStackTrace>
                        <encoding>UTF-8</encoding>
                        <argLine>-Dfile.encoding=UTF-8</argLine>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>

                <plugin>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>3.3.1</version>
                    <configuration>
                        <logViolationsToConsole>true</logViolationsToConsole>
                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        <configLocation>${checkstyle.configuration}</configLocation>
                        <suppressionsLocation>${checkstyle.suppressions}</suppressionsLocation>
                        <cacheFile>${checkstyle.cache}</cacheFile>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>10.13.0</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>check</id>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>de.qaware.maven</groupId>
                    <artifactId>go-offline-maven-plugin</artifactId>
                    <version>1.2.8</version>
                    <configuration>
                        <dynamicDependencies>
                            <DynamicDependency>
                                <groupId>org.apache.maven.surefire</groupId>
                                <artifactId>surefire-junit4</artifactId>
                                <version>2.22.2</version>
                                <repositoryType>PLUGIN</repositoryType>
                            </DynamicDependency>

                            <DynamicDependency>
                                <groupId>com.google.auto.service</groupId>
                                <artifactId>auto-service</artifactId>
                                <version>1.0</version>
                                <repositoryType>MAIN</repositoryType>
                            </DynamicDependency>
                        </dynamicDependencies>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.5.1</version>
                </plugin>

                <plugin>
                    <groupId>org.antlr</groupId>
                    <artifactId>antlr4-maven-plugin</artifactId>
                    <version>4.9.3</version>
                    <executions>
                        <execution>
                            <id>antlr</id>
                            <goals>
                                <goal>antlr4</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <listener>true</listener>
                        <visitor>true</visitor>
                        <treatWarningsAsErrors>true</treatWarningsAsErrors>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>com.github.ferstl</groupId>
                    <artifactId>depgraph-maven-plugin</artifactId>
                    <version>4.0.3</version>
                    <configuration>
                        <createImage>true</createImage>
                        <includes>${project.groupId}</includes>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-wrapper-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>

    <profiles>

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

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.13</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>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.3.0</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.6.3</version>
                        <configuration>
                            <notimestamp>true</notimestamp>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.1.0</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>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>enforcer-strict</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

            <build>
                <plugins>

                    <plugin>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>3.4.1</version>
                        <executions>
                            <execution>
                                <id>enforce</id>
                                <configuration>
                                    <rules>
                                        <DependencyConvergence />
                                        <requireJavaVersion>
                                            <version>1.8.0</version>
                                        </requireJavaVersion>
                                        <requireMavenVersion>
                                            <version>3.6.3</version>
                                        </requireMavenVersion>
                                        <bannedDependencies>
                                            <excludes>
                                                <exclude>commons-logging-api</exclude>
                                                <exclude>commons-logging</exclude>
                                                <exclude>org.apache.logging.log4j:log4j</exclude>
                                                <exclude>org.slf4j:slf4j-simple</exclude>
                                                <exclude>org.slf4j:slf4j-log4j12</exclude>
                                                <exclude>org.slf4j:slf4j-jdk14</exclude>
                                                <exclude>org.slf4j:nop</exclude>
                                                <exclude>org.slf4j:jcl</exclude>
                                            </excludes>
                                        </bannedDependencies>
                                        <banDuplicatePomDependencyVersions />
                                        <!--<reactorModuleConvergence />-->
                                    </rules>
                                </configuration>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

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

    </profiles>

</project>
