<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.microsoft.gctoolkit</groupId>
    <artifactId>gctoolkit</artifactId>
    <packaging>pom</packaging>
    <version>3.7.1-SNAPSHOT</version>

    <name>GCToolKit</name>
    <description>GC log parsing utilities</description>
    <url>https://github.com/microsoft/gctoolkit</url>

    <organization>
        <name>Microsoft Corporation</name>
        <url>https://microsoft.com</url>
    </organization>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:${repository.url}</connection>
        <developerConnection>scm:git:${repository.url}</developerConnection>
        <url>${repository.url}</url>
        <tag>gctoolkit-3.7.0</tag>
    </scm>
  
    <developers>
        <developer>
            <id>microsoft</id>
            <name>Microsoft Corporation</name>
        </developer>
    </developers>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/microsoft/gctoolkit/issues</url>
    </issueManagement>

    <properties>
        <revision>3.0.3-SNAPSHOT</revision>
        <checkstyle.version>10.26.1</checkstyle.version>
        <jreleaser.plugin.version>1.19.0</jreleaser.plugin.version>
        <junit5.version>5.13.4</junit5.version>
        <maven.antrun-plugin.version>3.1.0</maven.antrun-plugin.version>
        <maven.changes-plugin.version>3.0.0-M3</maven.changes-plugin.version>
        <maven.checkstyle-plugin.version>3.6.0</maven.checkstyle-plugin.version>
        <maven.clean-plugin.version>3.5.0</maven.clean-plugin.version>
        <maven.compiler-plugin.version>3.14.0</maven.compiler-plugin.version>
        <maven.compiler.release>11</maven.compiler.release>
        <maven.dependency-plugin.version>3.8.1</maven.dependency-plugin.version>
        <maven.deploy-plugin.version>3.1.4</maven.deploy-plugin.version>
        <maven.directory-maven-plugin.version>1.0</maven.directory-maven-plugin.version>
        <maven.enforcer-plugin.version>3.6.1</maven.enforcer-plugin.version>
        <maven.exec-plugin.version>3.5.1</maven.exec-plugin.version>
        <maven.install-plugin.version>3.1.4</maven.install-plugin.version>
        <maven.jacoco-plugin.version>0.8.13</maven.jacoco-plugin.version>
        <maven.jar-plugin.version>3.4.2</maven.jar-plugin.version>
        <maven.javadoc-plugin.version>3.11.2</maven.javadoc-plugin.version>
        <maven.jxr-plugin.version>3.6.0</maven.jxr-plugin.version>
        <maven.license-plugin.version>2.6.0</maven.license-plugin.version>
        <maven.pmd-plugin.version>3.28.0</maven.pmd-plugin.version>
        <maven.project-info-reports-plugin.version>3.9.0</maven.project-info-reports-plugin.version>
        <maven.rat-plugin.version>0.16.1</maven.rat-plugin.version>
        <maven.release-plugin.version>3.1.1</maven.release-plugin.version>
        <maven.resources-plugin.version>3.3.1</maven.resources-plugin.version>
        <maven.site-plugin.version>4.0.0-M16</maven.site-plugin.version>
        <maven.source-plugin.version>3.3.1</maven.source-plugin.version>
        <maven.spotbugs-plugin.version>4.9.3.2</maven.spotbugs-plugin.version>
        <maven.surefire-plugin.version>3.5.3</maven.surefire-plugin.version>
        <maven.version>3.9.11</maven.version>
        <maven.versions-plugin.version>2.18.0</maven.versions-plugin.version>
        <mutability.detector.version>0.9.1</mutability.detector.version>
        <pmd.version>7.22.0</pmd.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.github.repository>microsoft/gctoolkit</project.github.repository>
        <repository.url>git@github.com:${project.github.repository}.git</repository.url>
        <spotbugs.version>4.9.3</spotbugs.version>
    </properties>

    <modules>
        <module>gclogs</module>
        <module>api</module>
        <module>parser</module>
        <module>vertx</module>
        <module>sample</module>
        <module>IT</module>
    </modules>

    <!-- 
        These are listed in alphabetical order according to groupId 

        Dependency management is for setting common dependency config 
        and version numbers that you want the whole project to use.

        Dependencies (a later section) are for setting the actual dependencies 
        that you want to use.
    -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.microsoft.gctoolkit</groupId>
                <artifactId>gctoolkit-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.microsoft.gctoolkit</groupId>
                <artifactId>gctoolkit-parser</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.microsoft.gctoolkit</groupId>
                <artifactId>gctoolkit-vertx</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.microsoft.gctoolkit</groupId>
                <artifactId>gctoolkit-gclogs</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit5.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit5.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <!-- NOTE: Some plugin configuration is set in the reporting section below as opposed to here by design -->
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>${maven.spotbugs-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.github.spotbugs</groupId>
                            <artifactId>spotbugs</artifactId>
                            <version>${spotbugs.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <excludeFilterFile>spotbugs-excludes.xml</excludeFilterFile>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-changes-plugin</artifactId>
                    <version>${maven.changes-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${maven.checkstyle-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>${checkstyle.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven.clean-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler-plugin.version}</version>
                    <configuration>
                        <source>{maven.compiler.release}</source>
                        <target>{maven.compiler.release}</target>
                        <compilerArgs>
                            <arg>--module-version=${project.version}</arg>
                            <arg>-Xlint:unchecked</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven.dependency-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven.deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven.enforcer-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>enforce-maven</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireMavenVersion>
                                        <version>${maven.version}</version>
                                    </requireMavenVersion>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven.install-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven.jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven.source-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven.javadoc-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jxr-plugin</artifactId>
                    <version>${maven.jxr-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>${maven.pmd-plugin.version}</version>
                    <configuration>
                        <targetJdk>${maven.compiler.release}</targetJdk>
                        <rulesets>
                            <ruleset>pmd-ruleset.xml</ruleset>
                        </rulesets>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>net.sourceforge.pmd</groupId>
                            <artifactId>pmd-core</artifactId>
                            <version>${pmd.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>net.sourceforge.pmd</groupId>
                            <artifactId>pmd-java</artifactId>
                            <version>${pmd.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>net.sourceforge.pmd</groupId>
                            <artifactId>pmd-javascript</artifactId>
                            <version>${pmd.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>net.sourceforge.pmd</groupId>
                            <artifactId>pmd-jsp</artifactId>
                            <version>${pmd.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven.release-plugin.version}</version>
                    <configuration>
                        <releaseProfiles>release</releaseProfiles>
                        <projectVersionPolicyId>SemVerVersionPolicy</projectVersionPolicyId>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven.site-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${maven.project-info-reports-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven.resources-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${maven.antrun-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.rat</groupId>
                    <artifactId>apache-rat-plugin</artifactId>
                    <version>${maven.rat-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${maven.exec-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${maven.license-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${maven.versions-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.commonjava.maven.plugins</groupId>
                    <artifactId>directory-maven-plugin</artifactId>
                    <version>${maven.directory-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${maven.jacoco-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- If versions are not explicitly set it means they're inheriting from the pluginManagement section above -->
    <reporting>
        <plugins>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <configuration>
                    <plugins>
                        <plugin>
                            <groupId>org.mutabilitydetector</groupId>
                            <artifactId>MutabilityDetector4FindBugs</artifactId>
                            <version>${mutability.detector.version}</version>
                        </plugin>
                    </plugins>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-changes-plugin</artifactId>
                <configuration>
                    <includeOpenIssues>false</includeOpenIssues>
                    <onlyCurrentVersion>false</onlyCurrentVersion>
                </configuration>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>changes</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>checkstyle</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <configuration>
                    <targetJdk>${maven.compiler.release}</targetJdk>
                    <rulesets>
                        <!-- A rule set, that comes bundled with PMD -->
                        <ruleset>pmd-ruleset.xml</ruleset>
                    </rulesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>dependency-updates-report</report>
                            <report>plugin-updates-report</report>
                            <report>property-updates-report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.hjug.refactorfirst.plugin</groupId>
                <artifactId>refactor-first-maven-plugin</artifactId>
                <version>0.7.1</version>
                <!-- optional -->
                <configuration>
                    <showDetails>true</showDetails>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <id>report</id>
                            <reports>
                                <report>report</report>
                            </reports>
                    </reportSet>
                </reportSets>
            </plugin>

        </plugins>
    </reporting>

    <profiles>
        <profile>
            <!--
            Enabled by release:perform. See the maven-release-plugin configuration in the build section above.
            -->
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <!-- don't aggregate parser and vertx javadocs -->
                            <skippedModules>parser,vertx</skippedModules>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <preparationGoals>clean site</preparationGoals>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jreleaser</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jreleaser</groupId>
                        <artifactId>jreleaser-maven-plugin</artifactId>
                        <version>${jreleaser.plugin.version}</version>
                        <inherited>false</inherited>
                        <configuration>
                            <jreleaser>
                                <upload>
                                    <active>RELEASE</active>
                                </upload>
                                <release>
                                    <github>
                                        <skipTag>true</skipTag>
                                        <overwrite>true</overwrite>
                                        <changelog>
                                            <formatted>ALWAYS</formatted>
                                            <labelers>
                                                <labeler>
                                                    <label>maven-release</label>
                                                    <title>[maven-release-plugin]</title>
                                                </labeler>
                                                <labeler>
                                                    <label>bots</label>
                                                    <contributor>dependabot[bot]</contributor>
                                                </labeler>
                                                <labeler>
                                                    <label>not-github-issue</label>
                                                    <title>regex:.*(?!#\\d+).*</title>
                                                </labeler>
                                                <labeler>
                                                    <label>github-issue</label>
                                                    <title>#</title>
                                                </labeler>
                                            </labelers>
                                            <categories>
                                                <category>
                                                    <title>bots</title>
                                                    <labels>bots</labels>
                                                    <order>1</order>
                                                </category>
                                                <category>
                                                    <title>maven-release</title>
                                                    <labels>maven-release</labels>
                                                    <order>2</order>
                                                </category>
                                                <category>
                                                    <title>not-github-issue</title>
                                                    <labels>not-github-issue</labels>
                                                    <order>4</order>
                                                </category>
                                                <category>
                                                    <title>♻️  Changes</title>
                                                    <labels>github-issue</labels>
                                                    <order>3</order>
                                                </category>
                                            </categories>
                                            <contributors>
                                                <format>
                                                    - {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}
                                                </format>
                                            </contributors>
                                            <hide>
                                                <contributors>
                                                    <contributor>GitHub</contributor>
                                                    <contributor>Git</contributor>
                                                    <contributor>dependabot[bot]</contributor>
                                                </contributors>
                                                <categories>
                                                    <category>maven-release</category>
                                                    <category>bots</category>
                                                    <category>not-github-issue</category>
                                                </categories>
                                            </hide>
                                        </changelog>
                                    </github>
                                </release>
                            </jreleaser>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
