<?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>2.6.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>2.6.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>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <jdk.target>1.7</jdk.target>
    <license.header.path>${project.basedir}</license.header.path>
    <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>

    <!-- Plugin Versions -->
    <plugin.antrun>1.8</plugin.antrun>
    <plugin.assembly>3.1.0</plugin.assembly>
    <plugin.buildnumber>1.4</plugin.buildnumber>
    <plugin.compiler>3.7.0</plugin.compiler>
    <plugin.coveralls>4.3.0</plugin.coveralls>
    <plugin.enforcer>1.4.1</plugin.enforcer>
    <plugin.license>2.11</plugin.license>
    <plugin.jacoco>0.8.1</plugin.jacoco>
    <plugin.jar>3.1.0</plugin.jar>
    <plugin.source>3.0.1</plugin.source>
    <plugin.javadoc>3.0.1</plugin.javadoc>
    <plugin.release>2.5.3</plugin.release>
    <plugin.gpg>1.6</plugin.gpg>
    <plugin.shade>3.1.1</plugin.shade>
    <plugin.surefire>2.22.0</plugin.surefire>

    <!-- Dependency Versions -->
    <dependency.javax-inject>1</dependency.javax-inject>
    <dependency.junit>4.12</dependency.junit>
    <dependency.testng>6.8.8</dependency.testng>
    <dependency.commons-lang3>3.7</dependency.commons-lang3>
    <dependency.commons-collections4>4.2</dependency.commons-collections4>
  </properties>

  <modules>
    <module>airline-core</module>
    <module>airline-examples</module>
    <module>airline-io</module>
    <module>airline-help</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</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>

      <!-- 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>1.7</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-jdk7</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>${jdk.target}</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}/license-header.txt</header>
          <failIfMissing>true</failIfMissing>
          <aggregate>false</aggregate>
          <useDefaultMapping>true</useDefaultMapping>
          <strictCheck>true</strictCheck>
          <excludes>
            <exclude>license.txt</exclude>
            <exclude>pom.xml</exclude>
            <exclude>**/pom.xml</exclude>
            <exclude>**/*.config</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>

    <!-- M2E Configuration -->
    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings 
          only. It has no influence on the Maven build itself. -->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <versionRange>[2.11,)</versionRange>
                    <goals>
                      <goal>check</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>

        <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>gZC1X240fX8YXEo2T5Sgofe00S1bSaGdV</repoToken>
                  <scanForSources>true</scanForSources>
                  <sourceDirectories>
                    <sourceDirectory>airline-maven-plugin/target/generated-sources/</sourceDirectory>
                  </sourceDirectories>
                  <jacocoReports>
                    <jacocoReport>${project.outputDirectory}/jacoco-it/jacoco.xml</jacocoReport>
                  </jacocoReports>
                </configuration>
              </execution>
            </executions>
          </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</goal>
                  <goal>test-jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>javadoc-jdk7</id>
      <activation>
        <jdk>(,1.7]</jdk>
      </activation>
      <build>
        <plugins>
          <!-- 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>
              <encoding>UTF-8</encoding>
              <charset>UTF-8</charset>
              <docencoding>UTF-8</docencoding>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>javadoc-jdk8</id>
      <activation>
        <jdk>1.8</jdk>
      </activation>
      <build>
        <plugins>
          <!-- 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>
              <encoding>UTF-8</encoding>
              <charset>UTF-8</charset>
              <docencoding>UTF-8</docencoding>
              <additionalOptions>
                <option>-Xdoclint:none</option>
              </additionalOptions>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>javadoc-jdk10-plus</id>
      <activation>
        <jdk>10</jdk>
      </activation>
      <build>
        <plugins>
          <!-- 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>
              <encoding>UTF-8</encoding>
              <charset>UTF-8</charset>
              <docencoding>UTF-8</docencoding>
              <additionalOptions>
                <option>-Xdoclint:none</option>
              </additionalOptions>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
