<?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">
  <packaging>jar</packaging>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>pth_03</artifactId>
  <version>${revision}${sha1}${changelist}</version>
  <name>pth_03</name>
  <description>pth_03</description>
  <groupId>com.teragrep</groupId>
  <url>https://teragrep.com</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <java.version>1.8</java.version>
    <revision>0.0.2</revision>
    <changelist>-SNAPSHOT</changelist>
    <sha1/>
    <junit.jupiter.version>5.7.1</junit.jupiter.version>
  </properties>
  <scm>
    <connection>scm:git:https://github.com/teragrep/pth_03.git</connection>
    <developerConnection>scm:git:git@github.com:teragrep/pth_03.git</developerConnection>
    <url>https://github.com/teragrep/pth_03/tree/master</url>
  </scm>
  <licenses>
    <license>
      <name>GNU Affero General Public License v3.0</name>
      <url>https://www.gnu.org/licenses/agpl-3.0.txt</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>22</name>
      <email>22@teragrep.com</email>
      <organization>Teragrep</organization>
      <organizationUrl>https://teragrep.com</organizationUrl>
    </developer>
  </developers>
  <dependencies>
    <!-- logger -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.29</version>
    </dependency>
    <!-- antler -->
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr4</artifactId>
      <version>4.8</version>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit.jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <!-- Parameterized Tests -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>${junit.jupiter.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <directory>${project.basedir}/target</directory>
    <finalName>pth_03</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.0</version>
        <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>
        <version>3.5.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <source>8</source>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.15</version>
        <inherited>false</inherited>
        <executions>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <addDefaultLicenseMatchers>false</addDefaultLicenseMatchers>
          <licenses>
            <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
              <notes>Also allow the license url to be https.</notes>
              <patterns>
                <pattern>https://github.com/teragrep/teragrep/blob/main/LICENSE</pattern>
              </patterns>
            </license>
          </licenses>
          <consoleOutput>true</consoleOutput>
          <excludeSubProjects>false</excludeSubProjects>
          <excludes>
            <!-- git -->
            <exclude>.git/**</exclude>
            <exclude>.gitattributes</exclude>
            <exclude>.gitignore</exclude>
            <exclude>.gitmodules</exclude>
            <!-- ci -->
            <exclude>.github/workflows/*.yml</exclude>
            <exclude>.github/workflows/*.yaml</exclude>
            <exclude>toolchains.xml</exclude>
            <exclude>settings.xml</exclude>
            <!-- readme -->
            <exclude>README.adoc</exclude>
            <exclude>README.md</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-maven-plugin</artifactId>
        <version>4.8</version>
        <executions>
          <execution>
            <goals>
              <goal>antlr4</goal>
            </goals>
            <configuration>
              <visitor>true</visitor>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>process-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>target/generated-sources/antlr4</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M5</version>
        <configuration>
          <parallel>all</parallel>
          <useUnlimitedThreads>true</useUnlimitedThreads>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>de.flashpixx</groupId>
        <artifactId>rrd-antlr4</artifactId>
        <version>0.0.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.9</version>
      </plugin>
    </plugins>
  </reporting>   
  <profiles>
    <profile>
      <id>publish-maven-central</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
          <id>ossrh</id>
          <name>Central Repository OSSRH</name>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
      </distributionManagement>
    </profile>
    <profile>
      <id>publish-github-packages</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <repository>
          <id>github</id>
          <name>GitHub Packages</name>
          <url>https://maven.pkg.github.com/teragrep/pth_03</url>
        </repository>
      </distributionManagement>
    </profile>
  </profiles>
</project>
