<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.github.rvesse</groupId>
  <artifactId>airline-parent</artifactId>
  <packaging>pom</packaging>
  <version>3.2.0</version>
  <name>Airline - Parent</name>
  <description>Java annotation-based framework for parsing Git like command line structures</description>
  <url>https://github.com/rvesse/airline</url>

  <inceptionYear>2012</inceptionYear>

  <scm>
    <connection>scm:git:git@github.com:rvesse/airline.git</connection>
    <developerConnection>scm:git:git@github.com:rvesse/airline.git</developerConnection>
    <url>git:git@github.com:rvesse/airline.git</url>
    <tag>3.2.0</tag>
  </scm>

  <developers>
    <developer>
      <id>rvesse</id>
      <name>Rob Vesse</name>
      <email>rvesse@dotnetrdf.org</email>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <distributionManagement>
    <snapshotRepository>
      <id>central</id>
      <url>https://central.sonatype.com/repository/maven-snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <jdk.target>11</jdk.target>
    <jdk.enforced>11</jdk.enforced>
    <license.header.path>${project.basedir}</license.header.path>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- Coveralls API Token - MUST be injected into build via Maven properties -->
    <coveralls.token />

    <!-- Optionally skip coveralls for some modules -->
    <coveralls.skip>false</coveralls.skip>

    <!-- Plugin Versions -->
    <plugin.antrun>3.1.0</plugin.antrun>
    <plugin.assembly>3.7.1</plugin.assembly>
    <plugin.buildnumber>3.2.1</plugin.buildnumber>
    <plugin.central>0.8.0</plugin.central>
    <plugin.compiler>3.14.0</plugin.compiler>
    <plugin.coveralls>4.3.0</plugin.coveralls>
    <plugin.coveralls.jaxb>2.3.3-b02</plugin.coveralls.jaxb>
    <plugin.enforcer>3.5.0</plugin.enforcer>
    <plugin.license>2.11</plugin.license>
    <plugin.jacoco>0.8.13</plugin.jacoco>
    <plugin.jar>3.4.2</plugin.jar>
    <plugin.source>3.2.1</plugin.source>
    <plugin.javadoc>3.6.2</plugin.javadoc>
    <plugin.release>3.0.1</plugin.release>
    <plugin.gpg>3.1.0</plugin.gpg>
    <plugin.shade>3.1.1</plugin.shade>
    <plugin.surefire>3.5.3</plugin.surefire>

    <!-- Dependency Versions -->
    <dependency.javax-inject>2.0.1</dependency.javax-inject>
    <dependency.testng>7.11.0</dependency.testng>
    <dependency.classgraph>4.8.179</dependency.classgraph>
    <dependency.commons-lang3>3.18.0</dependency.commons-lang3>
    <dependency.commons-collections4>4.5.0</dependency.commons-collections4>
    <dependency.commons-csv>1.10.0</dependency.commons-csv>
  </properties>

  <modules>
    <module>airline-core</module>
    <module>airline-examples</module>
    <module>airline-io</module>
    <module>airline-help</module>
    <module>airline-prompts</module>
    <module>airline-backcompat-javaxinject</module>
    <module>airline-jpms-debug</module>
    <module>airline-jpms-resources</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>jakarta.inject</groupId>
        <artifactId>jakarta.inject-api</artifactId>
        <version>${dependency.javax-inject}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${dependency.commons-lang3}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
        <version>${dependency.commons-collections4}</version>
      </dependency>

      <dependency>
        <groupId>io.github.classgraph</groupId>
        <artifactId>classgraph</artifactId>
        <version>${dependency.classgraph}</version>
      </dependency>

      <!-- for testing -->
      <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${dependency.testng}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <!-- Compiler Plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${plugin.compiler}</version>
        <configuration>
          <source>11</source>
          <target>${jdk.target}</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>

      <!-- Surefire Plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${plugin.surefire}</version>
      </plugin>

      <!-- JAR Plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${plugin.jar}</version>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Enforcer Plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${plugin.enforcer}</version>
        <executions>
          <execution>
            <id>enforce-required-jdk</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>${jdk.enforced}</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- License Plugin -->
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${plugin.license}</version>
        <configuration>
          <header>${license.header.path}/code-header.txt</header>
          <failIfMissing>true</failIfMissing>
          <aggregate>false</aggregate>
          <useDefaultMapping>true</useDefaultMapping>
          <strictCheck>true</strictCheck>
          <excludes>
            <exclude>*.txt</exclude>
            <exclude>**/*.txt</exclude>
            <exclude>.github/**</exclude>
            <exclude>pom.xml</exclude>
            <exclude>**/pom.xml</exclude>
	        <exclude>**/*.config</exclude>
	        <exclude>**/*.bat</exclude>

            <!-- Integration Tests -->
            <exclude>**/verify.bsh</exclude>
            <exclude>**/it/*</exclude>
            <exclude>**/invoker.properties</exclude>

            <!-- Documentation -->
            <exclude>docs/</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Build Number Plugin -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>${plugin.buildnumber}</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>create</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doUpdate>false</doUpdate>
          <timestampFormat>{0,date,yyyy-MM-dd HH:mm:ss}</timestampFormat>
        </configuration>
      </plugin>

      <!-- Code Coverage Plugins -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${plugin.jacoco}</version>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <phase>process-test-classes</phase>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>package</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>check</id>
            <phase>package</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <rules>
                <rule>
                  <element>BUNDLE</element>
                  <limits>
                    <limit>
                      <counter>CLASS</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.75</minimum>
                    </limit>
                    <limit>
                      <counter>INSTRUCTION</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.75</minimum>
                    </limit>
                    <limit>
                      <counter>METHOD</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.75</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.75</minimum>
                    </limit>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.75</minimum>
                    </limit>
                    <limit>
                      <counter>COMPLEXITY</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.75</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
              <haltOnFailure>false</haltOnFailure>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>${plugin.antrun}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>${plugin.assembly}</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>

    <profile>
      <id>coveralls</id>
      <modules>
        <module>airline-maven-plugin</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <groupId>org.eluder.coveralls</groupId>
            <artifactId>coveralls-maven-plugin</artifactId>
            <version>${plugin.coveralls}</version>
            <executions>
              <execution>
                <id>upload-coveralls-status</id>
                <phase>package</phase>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <timestampFormat>yyyy-MM-dd HH:mm:ss</timestampFormat>
                  <repoToken>${coveralls.token}</repoToken>
                  <scanForSources>true</scanForSources>
                  <sourceDirectories>
                    <sourceDirectory>airline-maven-plugin/target/generated-sources/</sourceDirectory>
                  </sourceDirectories>
                  <jacocoReports>
                    <jacocoReport>airline-maven-plugin/target/jacoco-it/jacoco.xml</jacocoReport>
                  </jacocoReports>
                  <skip>${coveralls.skip}</skip>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.glassfish.jaxb</groupId>
                <artifactId>jaxb-runtime</artifactId>
                <version>${plugin.coveralls.jaxb}</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release</id>
      <modules>
        <module>airline-maven-plugin</module>
        <module>docs</module>
      </modules>
      <build>
        <plugins>
          <!-- Release Plugin -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>${plugin.release}</version>
            <configuration>
              <pushChanges>false</pushChanges>
            </configuration>
          </plugin>

          <!-- GPG Plugin for Signing -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${plugin.gpg}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- Source Plugin -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${plugin.source}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>package</phase>
                <goals>
                  <goal>jar-no-fork</goal>
                  <goal>test-jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- Javadoc Plugin -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${plugin.javadoc}</version>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <javadocVersion>${jdk.target}</javadocVersion>
              <quiet>true</quiet>
              <additionalOptions>
                <option>-Xdoclint:none</option>
              </additionalOptions>
            </configuration>
          </plugin>

          <!-- Central Publishing Plugin -->
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>${plugin.central}</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
              <waitUntil>published</waitUntil>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <repositories>
    <repository>
      <id>apache-repo-snapshots</id>
      <url>https://repository.apache.org/content/repositories/snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
</project>
