<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>fr.brouillard.oss</groupId>
  <artifactId>jgitver</artifactId>
  <version>0.9.0</version>
  <name>GIT versioning using jgit</name>
  <description>automatically calculates semver compatible version from git project info</description>
  <url>http://oss.brouillard.fr/jgitver</url>
  <inceptionYear>2016</inceptionYear>
  <organization>
    <name>Matthieu Brouillard</name>
    <url>http://oss.brouillard.fr</url>
  </organization>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>McFoggy</id>
      <name>Matthieu Brouillard</name>
      <url>http://blog.matthieu.brouillard.fr</url>
      <roles>
        <role>project creator</role>
      </roles>
      <timezone>Europe/Paris</timezone>
    </developer>
    <developer>
      <id>djarosz</id>
      <name>Dawid Jarosz</name>
      <url>https://github.com/djarosz</url>
      <organizationUrl>https://itmagination.com</organizationUrl>
      <roles>
        <role>contributor</role>
      </roles>
    </developer>
    <developer>
      <id>MSaguer</id>
      <name>Marc Saguer</name>
      <url>https://github.com/MSaguer</url>
      <roles>
        <role>contributor</role>
      </roles>
    </developer>
    <developer>
      <id>eduardozamin</id>
      <name>Eduardo Zamin</name>
      <url>https://github.com/eduardozamin</url>
      <roles>
        <role>contributor</role>
      </roles>
    </developer>
    <developer>
      <id>vromero</id>
      <name>Victor Romero</name>
      <url>https://github.com/vromero</url>
      <roles>
        <role>contributor</role>
      </roles>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:https://github.com/jgitver/jgitver.git</connection>
    <developerConnection>scm:git:https://github.com/jgitver/jgitver.git</developerConnection>
    <tag>0.9.0</tag>
    <url>http://oss.brouillard.fr/projects/jgitver/</url>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/jgitver/jgitver/issues</url>
  </issueManagement>
  <properties>
    <org.eclipse.jgit.version>5.1.3.201810200350-r</org.eclipse.jgit.version>
    <maven-failsafe-plugin.version>2.22.0</maven-failsafe-plugin.version>
    <junit.version>4.12</junit.version>
    <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
    <checkstyle.version>7.6</checkstyle.version>
    <guava.version>27.0.1-jre</guava.version>
    <license-maven-plugin.version>2.11</license-maven-plugin.version>
    <maven-jar-plugin.version>2.3.2</maven-jar-plugin.version>
    <maven.compiler.target>1.8</maven.compiler.target>
    <ossindex-maven-plugin.version>3.0.1</ossindex-maven-plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java-hamcrest.version>2.0.0.0</java-hamcrest.version>
    <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
    <maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
    <petitparser-core.version>2.2.0</petitparser-core.version>
    <maven.compiler.source>1.8</maven.compiler.source>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit</artifactId>
      <version>${org.eclipse.jgit.version}</version>
    </dependency>
    <dependency>
      <groupId>com.github.petitparser</groupId>
      <artifactId>petitparser-core</artifactId>
      <version>${petitparser-core.version}</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>java-hamcrest</artifactId>
      <version>${java-hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>sonatype</id>
      <url>https://oss.sonatype.org/content/groups/public</url>
    </repository>
  </repositories>
  <build>
    <pluginManagement>
      <plugins>
        <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></ignore>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <versionRange>[2.17,)</versionRange>
                    <goals>
                      <goal>check</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.sonatype.ossindex.maven</groupId>
          <artifactId>ossindex-maven-plugin</artifactId>
          <version>${ossindex-maven-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <showDeprecation>true</showDeprecation>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven-jar-plugin.version}</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
            <manifestEntries>
              <Automatic-Module-Name>fr.brouillard.oss.jgitver.library</Automatic-Module-Name>
              <X-Maven-Coordinates>${project.groupId}:${project.artifactId}:${project.version}</X-Maven-Coordinates>
              <X-Git-CommitId>${jgitver.git_sha1_full}</X-Git-CommitId>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license-maven-plugin.version}</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
          <properties>
            <owner>Matthieu Brouillard [http://oss.brouillard.fr/jgitver]</owner>
            <email>matthieu@brouillard.fr</email>
          </properties>
          <excludes>
            <exclude>**/README</exclude>
            <exclude>**/LICENSE</exclude>
            <exclude>.*</exclude>
            <exclude>src/doc/images/**</exclude>
            <exclude>src/quality/**</exclude>
            <exclude>src/test/resources/**</exclude>
            <exclude>src/main/resources/**</exclude>
            <exclude>mvnw</exclude>
            <exclude>mvnw.cmd</exclude>
            <exclude>.mvn/wrapper/*</exclude>
            <exclude>.mvn/jvm.config</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven-checkstyle-plugin.version}</version>
        <executions>
          <execution>
            <id>validate</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${checkstyle.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <propertiesLocation>${project.basedir}/src/quality/checkstyle/checkstyle_maven.properties</propertiesLocation>
          <configLocation>${project.basedir}/src/quality/checkstyle/checks.xml</configLocation>
          <encoding>UTF-8</encoding>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <excludes>**/*Test.java</excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${maven-failsafe-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>info</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>${maven-antrun-plugin.version}</version>
            <executions>
              <execution>
                <phase>validate</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <echo>used version: ${jgitver.used_version}</echo>
                    <echo>version calculated: ${jgitver.calculated_version}</echo>
                    <echo>dirty: ${jgitver.dirty}</echo>
                    <echo>head_committer_name: ${jgitver.head_committer_name}</echo>
                    <echo>head_commiter_email: ${jgitver.head_commiter_email}</echo>
                    <echo>head_commit_datetime: ${jgitver.head_commit_datetime}</echo>
                    <echo>git_sha1_full: ${jgitver.git_sha1_full}</echo>
                    <echo>git_sha1_8: ${jgitver.git_sha1_8}</echo>
                    <echo>branch_name: ${jgitver.branch_name}</echo>
                    <echo>head_tags: ${jgitver.head_tags}</echo>
                    <echo>head_annotated_tags: ${jgitver.head_annotated_tags}</echo>
                    <echo>head_lightweight_tags: ${jgitver.head_lightweight_tags}</echo>
                    <echo>base_tag: ${jgitver.base_tag}</echo>
                    <echo>all_tags: ${jgitver.all_tags}</echo>
                    <echo>all_annotated_tags: ${jgitver.all_annotated_tags}</echo>
                    <echo>all_lightweight_tags: ${jgitver.all_lightweight_tags}</echo>
                    <echo>all_version_tags: ${jgitver.all_version_tags}</echo>
                    <echo>all_version_annotated_tags: ${jgitver.all_version_annotated_tags}</echo>
                    <echo>all_version_lightweight_tags: ${jgitver.all_version_lightweight_tags}</echo>
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.4.1</version>
            <executions>
              <execution>
                <id>enforce-no-snapshots</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireReleaseDeps />
                    <requireReleaseVersion />
                    <requireJavaVersion>
                      <version>[1.8.0, 9)</version>
                    </requireJavaVersion>
                    <requireProperty>
                      <property>jgitver.dirty</property>
                      <regex>false</regex>
                      <regexMessage>You cannot release in a dirty state</regexMessage>
                    </requireProperty>
                    <requireProperty>
                      <property>jgitver.branch_name</property>
                      <regex>^$|master</regex>
                      <regexMessage>You must release from master or from a detached HEAD, current branch is '${jgitver.branch_name}'</regexMessage>
                    </requireProperty>
                  </rules>
                  <fail>true</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.ossindex.maven</groupId>
            <artifactId>ossindex-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>audit-dependencies</id>
                <phase>validate</phase>
                <goals>
                  <goal>audit</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>oss</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.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>2.9.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <additionalparam>-Xdoclint:none</additionalparam>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <executable>gpg</executable>
                  <useAgent>false</useAgent>
                  <keyname>${gpg.keyname}</keyname>
                  <passphraseServerId>${gpg.keyname}</passphraseServerId>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.3</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <repository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
    </profile>
    <profile>
      <id>checks</id>
      <activation>
        <property>
          <name>env.SNYK_API_TOKEN</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>io.snyk</groupId>
            <artifactId>snyk-maven-plugin</artifactId>
            <version>${snyk-maven-plugin.version}</version>
            <executions>
              <execution>
                <id>snyk-test</id>
                <phase>validate</phase>
                <goals>
                  <goal>test</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <apiToken>${env.SNYK_API_TOKEN}</apiToken>
              <failOnSeverity>medium</failOnSeverity>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <snyk-maven-plugin.version>1.1.1</snyk-maven-plugin.version>
      </properties>
    </profile>
  </profiles>
</project>
