<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 https://maven.apache.org/xsd/maven-4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.github.natty-parser</groupId>
  <artifactId>natty</artifactId>
  <packaging>jar</packaging>

  <version>1.1.2</version>

  <name>Natty Date Parser</name>
  <description>natural language date parser</description>
  <url>https://github.com/natty-parser/natty</url>

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

  <scm>
    <connection>scm:git:${project.scm.url}.git</connection>
    <developerConnection>scm:git:${project.scm.url}.git</developerConnection>
    <url>${project.url}</url>
    <tag>natty-1.1.2</tag>
  </scm>

  <developers>
    <developer>
      <id>mccartney</id>
      <name>Greg Oledzki</name>
      <url>https://github.com/mccartney</url>
      <roles>
        <role>developer</role>
      </roles>
      <timezone>1</timezone>
    </developer>
    <developer>
      <id>mihxil</id>
      <name>Michiel Meeuwissen</name>
      <url>https://github.com/mihxil</url>
      <roles>
        <role>developer</role>
      </roles>
      <timezone>Europe/Amsterdam</timezone>
    </developer>
  </developers>

  <properties>
    <grammar.dir>${basedir}/src/main/antlr3/org/natty/generated</grammar.dir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <additionalparam>-Xdoclint:none</additionalparam>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>

    <antlr.version>3.5.3</antlr.version>
    <slf4j.version>2.0.17</slf4j.version>
  </properties>

  <build>
    <defaultGoal>install</defaultGoal>
    <plugins>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.9.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
          <autoPublish>true</autoPublish>
          <waitUntil>published</waitUntil>
        </configuration>
      </plugin>

      <!-- need to force a new version of the release plugin for git support-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <mavenExecutorId>forked-path</mavenExecutorId>
        </configuration>
      </plugin>


      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.14.1</version>
      </plugin>

      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.5.0</version>
        <configuration>
          <archive>
            <index>true</index>
            <manifest>
              <mainClass>org.natty.Parser</mainClass>
            </manifest>
            <manifestEntries>
              <url>${project.url}</url>
              <Automatic-Module-Name>org.natty</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

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

      <!-- ANTLR code generation plugin -->
      <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>antlr3-maven-plugin</artifactId>
        <version>${antlr.version}</version>
        <executions>
          <execution>
            <id>debug</id>
            <goals>
              <goal>antlr</goal>
            </goals>
            <configuration>
              <debug>true</debug>
              <libDirectory>src/main/antlr3/org/natty/generated/imports</libDirectory>
              <includes>
                <include>org/natty/generated/DateLexer.g</include>
                <include>org/natty/generated/DateParser.g</include>
              </includes>
              <excludes>
                <exclude>org/natty/generated/imports/NumericRules.g</exclude>
              </excludes>
            </configuration>
          </execution>
          <execution>
            <id>non-debug</id>
            <goals>
              <goal>antlr</goal>
            </goals>
            <configuration>
              <debug>false</debug>
              <libDirectory>src/main/antlr3/org/natty/generated/imports</libDirectory>
              <excludes>
                <exclude>org/natty/generated/DateLexer.g</exclude>
                <exclude>org/natty/generated/DateParser.g</exclude>
                <exclude>org/natty/generated/imports/NumericRules.g</exclude>
              </excludes>
            </configuration>
          </execution>

        </executions>
      </plugin>


      <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>maven-gunit-plugin</artifactId>
        <version>${antlr.version}</version>
        <executions>
          <execution>
            <id>maven-gunit-plugin</id>
            <phase>test</phase>
            <goals>
              <goal>gunit</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.5.4</version>
        <configuration>
          <systemPropertyVariables>

            <java.util.logging.config.file>${project.basedir}/src/test/resources/logging.properties</java.util.logging.config.file>
            <java.util.logging.manager>java.util.logging.LogManager</java.util.logging.manager>
          </systemPropertyVariables>
          <argLine>-Dfile.encoding=UTF-8</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <version>2.19.1</version>
        <configuration>
          <rulesUri>file:///${maven.multiModuleProjectDirectory}/rules.xml</rulesUri>
        </configuration>
      </plugin>

    </plugins>
  </build>


  <profiles>
    <profile>
      <id>release</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>

          <!-- sign artifacts -->
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.8</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <!-- attach sources and javadocs -->
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.3.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.12.0</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <excludePackageNames>
                org.natty.generated
              </excludePackageNames>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>


  <dependencies>
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr-runtime</artifactId>
      <version>${antlr.version}</version>
    </dependency>

    <!-- using junit 4 because of gunit -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>gunit</artifactId>
      <version>3.5.3</version>
      <scope>test</scope>
    </dependency>

  </dependencies>
</project>
