<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.flowlogix</groupId>
    <artifactId>flowlogix</artifactId>
    <version>5.1.4</version>
    <packaging>pom</packaging>
    <name>Flow Logix Root</name>
    <description>Flow Logix Utility Library Root POM</description>

    <url>https://github.com/flowlogix/flowlogix</url>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>lprimak</id>
            <name>Lenny Primak</name>
            <email>lenny@flowlogix.com</email>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.release>11</maven.compiler.release>
        <payara.start.skip>${skipITs}</payara.start.skip>

        <docs.phase>deploy</docs.phase>
        <release.profile>release-flowlogix-to-central</release.profile>
        <gpg.keyname>Flow Logix, Inc.</gpg.keyname>
        <staging.server>flowlogix-maven-central</staging.server>
        <nexus.url>https://oss.sonatype.org/</nexus.url>
        <skip.staging>false</skip.staging>
        <auto.release>true</auto.release>

        <webdriver.browser>chromeheadless</webdriver.browser>
        <payara.version>5.2022.3</payara.version>
        <groovy.version>4.0.6</groovy.version>
        <jacocoPort>52212</jacocoPort>
        <jacocoAgent />
        <jdk11SurefireOptions />
        <jdk11FailsafeOptions />

        <!-- checkstyle -->
        <checkstyle.configLocation>${flowlogix.basedir}/checkstyle/checkstyle.xml</checkstyle.configLocation>
        <checkstyle.supressionsLocation>${flowlogix.basedir}/checkstyle/suppressions.xml</checkstyle.supressionsLocation>
        <checkstyle.headerLocation>${flowlogix.basedir}/checkstyle/header.txt</checkstyle.headerLocation>
    </properties>

    <modules>
        <module>flowlogix-bom</module>
        <module>jakarta-ee</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.1.0</version>
                <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-source-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.commonjava.maven.plugins</groupId>
                <artifactId>directory-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>directories</id>
                        <goals>
                            <goal>directory-of</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <property>flowlogix.basedir</property>
                            <project>
                                <groupId>com.flowlogix</groupId>
                                <artifactId>flowlogix</artifactId>
                            </project>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <version>2.1.0</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.groovy</groupId>
                        <artifactId>groovy-all</artifactId>
                        <version>${groovy.version}</version>
                        <scope>runtime</scope>
                        <type>pom</type>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>testGroups</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <scripts>
                                <!-- combine individual test profiles into a single test group property -->
                                <script>${flowlogix.basedir}/setTestGroupProperties.groovy</script>
                            </scripts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.soebes.maven.plugins</groupId>
                <artifactId>echo-maven-plugin</artifactId>
                <version>0.5.0</version>
                <executions>
                    <execution>
                        <id>echo test groups</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>echo</goal>
                        </goals>
                        <configuration>
                            <echos>
                                <echo>Test Groups (Tags): ${groups}</echo>
                            </echos>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <configLocation>${checkstyle.configLocation}</configLocation>
                    <suppressionsLocation>${checkstyle.supressionsLocation}</suppressionsLocation>
                    <headerLocation>${checkstyle.headerLocation}</headerLocation>
                    <enableRSS>false</enableRSS>
                    <linkXRef>true</linkXRef>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <failOnViolation>true</failOnViolation>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <enableRulesSummary>true</enableRulesSummary>
                    <propertyExpansion>flowlogix.basedir=${flowlogix.basedir}</propertyExpansion>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>10.5.0</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.8</version>
                <configuration>
                    <includes>
                        <include>com/flowlogix/**</include>
                    </includes>
                    <excludes>
                        <exclude>com/flowlogix/**/*Test</exclude>
                        <exclude>com/flowlogix/**/*Test$*</exclude>
                        <exclude>com/flowlogix/**/*IT</exclude>
                        <exclude>com/flowlogix/**/*IT$*</exclude>
                        <exclude>com/flowlogix/**/__EJB31_Generated*</exclude>
                        <!-- cause too many coverage misses -->
                        <exclude>com.flowlogix/examples/entities/*</exclude>
                        <exclude>com.flowlogix/examples/Deployments</exclude>
                    </excludes>
                    <classDumpDir>${flowlogix.basedir}/target/classes-jacoco</classDumpDir>
                    <address>localhost</address>
                    <port>${jacocoPort}</port>
                    <reset>true</reset>
                    <propertyName>jacocoAgent</propertyName>
                </configuration>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.10.1</version>
                    <configuration>
                        <compilerArgs>
                            <arg>-Xlint:deprecation</arg>
                            <arg>-Xlint:unchecked</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M7</version>
                    <configuration>
                        <parallel>all</parallel>
                        <threadCount>10</threadCount>
                        <redirectTestOutputToFile>true</redirectTestOutputToFile>
                        <argLine>@{jacocoAgent} @{jdk11SurefireOptions}</argLine>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.0.0-M7</version>
                    <executions>
                        <execution>
                            <id>integration-test</id>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <parallel>all</parallel>
                        <threadCount>10</threadCount>
                        <redirectTestOutputToFile>true</redirectTestOutputToFile>
                        <argLine>@{jacocoAgent} @{jdk11FailsafeOptions}</argLine>
                        <systemPropertyVariables>
                            <arquillian.launch>${arquillian.launch}</arquillian.launch>
                            <integration.test.mode>${integration.test.mode}</integration.test.mode>
                            <webdriver.browser>${webdriver.browser}</webdriver.browser>
                            <webdriver.chrome.driver>${webdriver.chrome.driver}</webdriver.chrome.driver>
                            <webdriver.chrome.binary>${webdriver.chrome.binary}</webdriver.chrome.binary>
                            <webdriver.gecko.driver>${webdriver.gecko.driver}</webdriver.gecko.driver>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                    <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>
                    <version>3.4.1</version>
                    <configuration>
                        <doclint>all,-reference</doclint>
                        <overview>${project.basedir}/src/main/java/overview.html</overview>
                        <sourcepath>${project.build.directory}/generated-sources/delombok
                            :${project.build.directory}/generated-sources/annotations</sourcepath>
                    </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.basedir}/src/main/java</sourceDirectory>
                        <addOutputDirectory>false</addOutputDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>delombok</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.3.0</version>
                    <configuration>
                        <overWrite>false</overWrite>
                        <artifactItems>
                            <artifactItem>
                                <groupId>fish.payara.distributions</groupId>
                                <artifactId>payara</artifactId>
                                <version>${payara.version}</version>
                                <type>zip</type>
                            </artifactItem>
                        </artifactItems>
                        <skip>${payara.start.skip}</skip>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.0.0</version>
                    <executions>
                        <execution>
                            <id>default-deploy</id>
                            <phase>none</phase>
                        </execution>
                        <execution>
                            <id>deploy</id>
                            <goals>
                                <goal>deploy</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.0-M7</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <pushChanges>false</pushChanges>
                        <localCheckout>true</localCheckout>
                        <preparationGoals>validate</preparationGoals>
                        <releaseProfiles>${release.profile}</releaseProfiles>
                        <tagNameFormat>Version-@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.13</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>${staging.server}</serverId>
                        <nexusUrl>${nexus.url}</nexusUrl>
                        <autoReleaseAfterClose>${auto.release}</autoReleaseAfterClose>
                        <skipStaging>${skip.staging}</skipStaging>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                    <configuration>
                        <keyname>${gpg.keyname}</keyname>
                        <passphraseServerId>${gpg.keyname}</passphraseServerId>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.4.1</version>
                    <configuration>
                        <shadedArtifactAttached>true</shadedArtifactAttached>
                        <shadedClassifierName>jakarta</shadedClassifierName>
                        <createDependencyReducedPom>false</createDependencyReducedPom>
                        <minimizeJar>false</minimizeJar>
                        <transformers>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                            <transformer implementation="io.yupiik.maven.shade.transformer.RelocationTransformer">
                                <delegates>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" />
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                                        <resource>WEB-INF/faces-config.xml</resource>
                                    </transformer>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                                        <resource>WEB-INF/web.xml</resource>
                                    </transformer>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                                        <resource>META-INF/web-fragment.xml</resource>
                                    </transformer>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                                        <resource>WEB-INF/errorpages/invalidErrorPage.xhtml</resource>
                                    </transformer>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                                        <resource>META-INF/persistence.xml</resource>
                                    </transformer>
                                </delegates>
                            </transformer>
                        </transformers>
                        <artifactSet>
                            <includes>
                                <include>${project.groupId}:${project.artifactId}</include>
                            </includes>
                        </artifactSet>
                        <relocations combine.children="append">
                            <relocation>
                                <pattern>javax.faces</pattern>
                                <shadedPattern>jakarta.faces</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.el</pattern>
                                <shadedPattern>jakarta.el</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.annotation</pattern>
                                <shadedPattern>jakarta.annotation</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.servlet</pattern>
                                <shadedPattern>jakarta.servlet</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.persistence</pattern>
                                <shadedPattern>jakarta.persistence</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.enterprise</pattern>
                                <shadedPattern>jakarta.enterprise</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.xml.bind</pattern>
                                <shadedPattern>jakarta.xml.bind</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.validation</pattern>
                                <shadedPattern>jakarta.validation</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.inject</pattern>
                                <shadedPattern>jakarta.inject</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.interceptor</pattern>
                                <shadedPattern>jakarta.interceptor</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.activation</pattern>
                                <shadedPattern>jakarta.activation</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.ws.rs</pattern>
                                <shadedPattern>jakarta.ws.rs</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.jws</pattern>
                                <shadedPattern>jakarta.jws</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.cache</pattern>
                                <shadedPattern>jakarta.cache</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.xml.ws</pattern>
                                <shadedPattern>jakarta.xml.ws</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>javax.xml.soap</pattern>
                                <shadedPattern>jakarta.xml.soap</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>window.jsf</pattern>
                                <shadedPattern>window.faces</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>jsf.ajax</pattern>
                                <shadedPattern>faces.ajax</shadedPattern>
                            </relocation>
                        </relocations>
                    </configuration>
                    <executions>
                        <execution>
                            <id>jakarta</id>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>io.yupiik.maven</groupId>
                            <artifactId>maven-shade-transformers</artifactId>
                            <version>0.0.3</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

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

    <profiles>
        <profile>
            <id>payara-server-remote</id>
            <properties>
                <payara.start.skip>true</payara.start.skip>
            </properties>
        </profile>
        <profile>
            <id>payara-docker</id>
            <properties>
                <payara.start.skip>true</payara.start.skip>
                <arquillian.launch>payara-docker</arquillian.launch>
            </properties>
        </profile>
        <profile>
            <id>stress-test</id>
            <properties>
                <test_groups>StressTest</test_groups>
            </properties>
        </profile>
        <profile>
            <id>ui-test</id>
            <properties>
                <test_groups>UserInterface</test_groups>
            </properties>
        </profile>
        <profile>
            <id>all-tests</id>
            <properties>
                <test_groups>any()</test_groups>
            </properties>
        </profile>
        <profile>
            <id>release-flowlogix-to-central</id>
            <properties>
                <docs.phase>package</docs.phase>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-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>
                <docs.phase>package</docs.phase>
                <staging.server>hope-nexus-artifacts</staging.server>
                <nexus.url>https://nexus.hope.nyc.ny.us/</nexus.url>
                <skip.staging>true</skip.staging>
            </properties>
            <distributionManagement>
                <repository>
                    <id>${staging.server}</id>
                    <url>${nexus.url}repository/maven-releases</url>
                </repository>
            </distributionManagement>
        </profile>
        <profile>
            <id>checkstyle</id>
            <activation>
                <property>
                    <name>checkstyle.skip</name>
                    <value>!true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <goals>
                                    <goal>checkstyle</goal>
                                </goals>
                            </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>
                                    <goal>dump</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk11plus</id>
            <activation>
                <jdk>[11,)</jdk>
            </activation>
            <properties>
                <jdk11SurefireOptions>-Xshare:off</jdk11SurefireOptions>
                <jdk11FailsafeOptions>--add-opens java.base/java.lang=ALL-UNNAMED</jdk11FailsafeOptions>
            </properties>
        </profile>
    </profiles>

    <scm>
        <url>https://github.com/flowlogix/flowlogix</url>
        <connection>scm:git:git@github.com:flowlogix/flowlogix.git</connection>
        <developerConnection>scm:git:git@github.com:flowlogix/flowlogix.git</developerConnection>
        <tag>Version-5.1.4</tag>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>flowlogix-maven-central</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

</project>
