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

    <artifactId>infra-pom</artifactId>
    <version>3</version>

    <parent>
        <groupId>com.flowlogix</groupId>
        <artifactId>base-pom</artifactId>
        <version>3</version>
    </parent>

    <name>Infrastructure POM</name>
    <description>Opinionated infrastructure to be used as parent POM</description>
    <url>https://github.com/flowlogix/base-pom</url>

    <properties>
        <project.build.outputTimestamp>2024-02-17T04:57:35Z</project.build.outputTimestamp>
        <docs.phase>deploy</docs.phase>
        <delombok.phase>none</delombok.phase>
        <snippet.path.p1>${project.build.sourceDirectory}</snippet.path.p1>
        <snippet.path.p2>${project.build.testSourceDirectory}</snippet.path.p2>
        <snippet.path.p3>${project.basedir}/src/demo/java</snippet.path.p3>
        <snippet.path>${snippet.path.p1}:${snippet.path.p2}:${snippet.path.p3}</snippet.path>
        <release.profile>release-flowlogix-to-central</release.profile>
        <release.profiles>${release.profile}</release.profiles>
        <gpg.keyname>Flow Logix, Inc.</gpg.keyname>
        <staging.server>flowlogix-maven-central-s01</staging.server>
        <nexus.url>https://s01.oss.sonatype.org</nexus.url>
        <jboss.unzip.url>https://repository.jboss.org/nexus/content/repositories/unzip/org/jboss</jboss.unzip.url>
        <central.archive.url>https://oss.sonatype.org/service/local/repositories/releases/archive</central.archive.url>
        <webdriver.browser>chromeheadless</webdriver.browser>
        <jacocoAddress>localhost</jacocoAddress>
        <jacocoPort>52212</jacocoPort>
        <jacocoReset>true</jacocoReset>
        <jacocoAgent />
        <jdk11SurefireOptions>-Xshare:off</jdk11SurefireOptions>
        <jdk11FailsafeOptions />
        <compiler.show.warnings>true</compiler.show.warnings>
        <compiler.deprecation.arg>-Xlint:deprecation</compiler.deprecation.arg>
        <compiler.unchecked.arg>-Xlint:unchecked</compiler.unchecked.arg>
        <compiler.annotation.processing>full</compiler.annotation.processing>
        <test.parallel>all</test.parallel>
        <test.thread.count>10</test.thread.count>
        <test.run.order>random</test.run.order>
        <test.redirect.to.file>true</test.redirect.to.file>
        <deploy.at-end>true</deploy.at-end>
        <jar.skip-if-empty>true</jar.skip-if-empty>
        <javadoc.doclint>all,-reference</javadoc.doclint>
        <javadoc.sourcepath>${project.build.sourceDirectory}
            :${project.build.directory}/generated-sources/annotations</javadoc.sourcepath>
        <javadoc.snippet.path>${snippet.path}</javadoc.snippet.path>
        <javadoc.snippet.path.options>--snippet-path ${javadoc.snippet.path}</javadoc.snippet.path.options>
        <checkstyle.configLocation>checkstyle.xml</checkstyle.configLocation>
        <checkstyle.headerLocation>header.txt</checkstyle.headerLocation>
        <checkstyle.supressionsLocation />
        <checkstyle.excludes>**/module-info.java</checkstyle.excludes>

        <jakarta.ee.version>10.0.0</jakarta.ee.version>
        <groovy.version>4.0.18</groovy.version>
        <lombok.version>1.18.30</lombok.version>
        <shrinkwrap.api.version>1.2.6</shrinkwrap.api.version>
        <shrinkwrap.resolver.version>3.3.0</shrinkwrap.resolver.version>
        <arquillian.version>1.8.0.Final</arquillian.version>
        <arquillian.drone.version>2.5.6</arquillian.drone.version>
        <arquillian.graphene.version>2.5.4</arquillian.graphene.version>
    </properties>

    <distributionManagement>
        <snapshotRepository>
            <id>${staging.server}</id>
            <url>${nexus.url}/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <plugins>
            <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>
                                <requireMavenVersion>
                                    <version>3.6</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <id>add-demos-parse-version</id>
                        <configuration>
                            <sources>
                                <source>src/demo/java</source>
                            </sources>
                            <versionString>${jakarta.ee.version}</versionString>
                            <propertyPrefix>jakarta.ee.parsed</propertyPrefix>
                        </configuration>
                        <phase>validate</phase>
                        <goals>
                            <goal>add-test-source</goal>
                            <goal>parse-version</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <configLocation>${checkstyle.configLocation}</configLocation>
                    <headerLocation>${checkstyle.headerLocation}</headerLocation>
                    <suppressionsLocation>${checkstyle.supressionsLocation}</suppressionsLocation>
                    <linkXRef>true</linkXRef>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <failOnViolation>true</failOnViolation>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <enableRulesSummary>true</enableRulesSummary>
                    <excludes>${checkstyle.excludes}</excludes>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>checkstyle</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>10.13.0</version>
                    </dependency>
                    <dependency>
                        <groupId>com.flowlogix</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>3</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.11</version>
                    <configuration>
                        <address>${jacocoAddress}</address>
                        <port>${jacocoPort}</port>
                        <reset>${jacocoReset}</reset>
                        <propertyName>jacocoAgent</propertyName>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <showWarnings>${compiler.show.warnings}</showWarnings>
                        <compilerArgs combine.children="append">
                            <arg>${compiler.deprecation.arg}</arg>
                            <arg>${compiler.unchecked.arg}</arg>
                        </compilerArgs>
                        <proc>${compiler.annotation.processing}</proc>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <parallel>${test.parallel}</parallel>
                        <threadCount>${test.thread.count}</threadCount>
                        <runOrder>${test.run.order}</runOrder>
                        <redirectTestOutputToFile>${test.redirect.to.file}</redirectTestOutputToFile>
                        <argLine>@{jacocoAgent} @{jdk11SurefireOptions}</argLine>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>integration-test</id>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <parallel>${test.parallel}</parallel>
                        <threadCount>${test.thread.count}</threadCount>
                        <runOrder>${test.run.order}</runOrder>
                        <redirectTestOutputToFile>${test.redirect.to.file}</redirectTestOutputToFile>
                        <argLine>@{jacocoAgent} @{jdk11FailsafeOptions}</argLine>
                        <systemPropertyVariables combine.children="append">
                            <webdriver.browser>${webdriver.browser}</webdriver.browser>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>${docs.phase}</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <sourcepath>${javadoc.sourcepath}</sourcepath>
                        <doclint>${javadoc.doclint}</doclint>
                        <additionalOptions>${javadoc.snippet.path.options}</additionalOptions>
                        <links combine.children="append">
                            <link>https://jakarta.ee/specifications/platform/${jakarta.ee.parsed.majorVersion}/apidocs</link>
                            <link>${jboss.unzip.url}/shrinkwrap/shrinkwrap-api/${shrinkwrap.api.version}/shrinkwrap-api-${shrinkwrap.api.version}-javadoc.jar-unzip</link>
                            <link>https://javadoc.io/doc/org.projectlombok/lombok/${lombok.version}</link>
                        </links>
                        <notimestamp>true</notimestamp>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <phase>${docs.phase}</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.projectlombok</groupId>
                    <artifactId>lombok-maven-plugin</artifactId>
                    <version>1.18.20.0</version>
                    <configuration>
                        <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                        <addOutputDirectory>false</addOutputDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>${delombok.phase}</phase>
                            <goals>
                                <goal>delombok</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <configuration>
                        <retryFailedDeploymentCount>5</retryFailedDeploymentCount>
                        <deployAtEnd>${deploy.at-end}</deployAtEnd>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <skipIfEmpty>${jar.skip-if-empty}</skipIfEmpty>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <pushChanges>false</pushChanges>
                        <localCheckout>true</localCheckout>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                        <preparationGoals>validate</preparationGoals>
                        <preparationProfiles>skip-checkstyle</preparationProfiles>
                        <releaseProfiles>${release.profiles},docs</releaseProfiles>
                        <tagNameFormat>Version-@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.simplify4u.plugins</groupId>
                    <artifactId>sign-maven-plugin</artifactId>
                    <version>1.0.1</version>
                    <configuration>
                        <serverId>${gpg.keyname}</serverId>
                        <skipNoKey>false</skipNoKey>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.5.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <artifactId>maven-jxr-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release-flowlogix-to-central</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.simplify4u.plugins</groupId>
                        <artifactId>sign-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <repository>
                    <id>${staging.server}</id>
                    <url>${nexus.url}/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
        <profile>
            <id>release-flowlogix-to-hope</id>
            <properties>
                <staging.server>hope-nexus-artifacts</staging.server>
                <nexus.url>https://nexus.hope.nyc.ny.us</nexus.url>
            </properties>
            <distributionManagement>
                <repository>
                    <id>${staging.server}</id>
                    <url>${nexus.url}/repository/maven-releases/</url>
                </repository>
            </distributionManagement>
        </profile>
        <profile>
            <id>docs</id>
            <properties>
                <docs.phase>package</docs.phase>
            </properties>
        </profile>
        <profile>
            <id>skip-checkstyle</id>
            <activation>
                <property>
                    <name>checkstyle.skip</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage-remote</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                    <goal>dump</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
