<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://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-maven-plugin</artifactId>
  <version>1.9.0</version>
  <packaging>maven-plugin</packaging>
  <name>jgitver Maven Plugin</name>
  <description>standalone maven plugin to automatically define versions using jgitver</description>
  <url>http://oss.brouillard.fr/jgitver-maven-plugin</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>xeagle2</id>
      <name>Yuriy Zaplavnov</name>
      <url>https://github.com/xeagle2</url>
      <roles>
        <role>contributor</role>
      </roles>
    </developer>
    <developer>
      <id>jschneider</id>
      <name>Johannes Schneider</name>
      <url>https://github.com/jschneider</url>
      <roles>
        <role>contributor</role>
      </roles>
    </developer>
    <developer>
      <id>JHeiner</id>
      <name>Jeremy Heiner</name>
      <url>https://github.com/JHeiner</url>
      <roles>
        <role>contributor</role>
      </roles>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:https://github.com/jgitver/jgitver-maven-plugin.git</connection>
    <developerConnection>scm:git:https://github.com/jgitver/jgitver-maven-plugin.git</developerConnection>
    <tag>1.9.0</tag>
    <url>http://oss.brouillard.fr/projects/jgitver-maven-plugin/</url>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/jgitver/jgitver-maven-plugin/issues</url>
  </issueManagement>
  <ciManagement>
    <system>travis-ci</system>
    <url>https://travis-ci.org/jgitver/jgitver-maven-plugin</url>
  </ciManagement>
  <properties>
    <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
    <spotless.version>2.6.1</spotless.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
    <simple-xml.version>2.7.1</simple-xml.version>
    <plexus-component-metadata.version>1.7.1</plexus-component-metadata.version>
    <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
    <maven-plugin-annotations.version>3.2</maven-plugin-annotations.version>
    <guava.version>27.0.1-jre</guava.version>
    <maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
    <easymock.version>4.0.2</easymock.version>
    <maven-invoker-plugin.version>1.10</maven-invoker-plugin.version>
    <plexus-component-annotations.version>1.5.5</plexus-component-annotations.version>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven-core.version>3.3.9</maven-core.version>
    <maven-surefire-plugin.version>3.0.0-M3</maven-surefire-plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <commons-lang3.version>3.4</commons-lang3.version>
    <it.directory>${project.build.directory}</it.directory>
    <junit.version>4.13.1</junit.version>
    <plexus-utils.version>3.1.0</plexus-utils.version>
    <jgitver.version>0.14.0</jgitver.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <version>4.2.3</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.2.11</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven-core.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>${maven-plugin-annotations.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>${plexus-utils.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven-core.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-component-annotations</artifactId>
      <version>${plexus-component-annotations.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>fr.brouillard.oss</groupId>
      <artifactId>jgitver</artifactId>
      <version>${jgitver.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>${commons-lang3.version}</version>
    </dependency>
    <dependency>
      <groupId>org.simpleframework</groupId>
      <artifactId>simple-xml</artifactId>
      <version>${simple-xml.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>${easymock.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources-filtered</directory>
      </resource>
    </resources>
    <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>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <versionRange>[3.2,)</versionRange>
                    <goals>
                      <goal>check</goal>
                      <goal>descriptor</goal>
                      <goal>helpmojo</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.plexus</groupId>
                    <artifactId>plexus-component-metadata</artifactId>
                    <versionRange>[1.7.1,)</versionRange>
                    <goals>
                      <goal>generate-metadata</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>com.diffplug.spotless</groupId>
                    <artifactId>spotless-maven-plugin</artifactId>
                    <versionRange>[2.6.1,)</versionRange>
                    <goals>
                      <goal>check</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>${spotless.version}</version>
          <configuration>
            <java>
              <googleJavaFormat>
                <version>1.9</version>
                <style>GOOGLE</style>
              </googleJavaFormat>
            </java>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-metadata</artifactId>
        <version>${plexus-component-metadata.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>generate-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.6.0</version>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <phase>process-classes</phase>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <execution>
            <id>help-goal</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <goalPrefix>jgitver</goalPrefix>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
            <manifestEntries>
              <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>2.11</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-maven-plugin]</owner>
            <email>matthieu@brouillard.fr</email>
          </properties>
          <mapping>
            <java>SLASHSTAR_STYLE</java>
          </mapping>
          <excludes>
            <exclude>mvnw</exclude>
            <exclude>mvnw.cmd</exclude>
            <exclude>.mvn/wrapper/**</exclude>
            <exclude>.mvn/jvm.config</exclude>
            <exclude>.mvn/maven.config</exclude>
            <exclude>**/README</exclude>
            <exclude>**/LICENSE</exclude>
            <exclude>.okhttpcache/**</exclude>
            <exclude>.*</exclude>
            <exclude>**/.keepgit</exclude>
            <exclude>**/changelog.mustache</exclude>
            <exclude>**/CHANGELOG</exclude>
            <exclude>src/quality/**</exclude>
            <exclude>src/doc/images/**</exclude>
            <exclude>src/it/resources/**</exclude>
            <exclude>src/it/**/invoker.properties</exclude>
            <exclude>src/test/resources/**</exclude>
            <exclude>src/main/resources/**</exclude>
            <exclude>src/test/java/fr/brouillard/oss/jgitver/JGitverUtilsTest.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>check-styling</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>${maven-clean-plugin.version}</version>
        <executions>
          <execution>
            <id>default-clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
            <configuration>
              <filesets>
                <fileset>
                  <directory>${it.directory}</directory>
                </fileset>
              </filesets>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <executions>
          <execution>
            <id>default-test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <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>none</failOnSeverity>
            </configuration>
          </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>
            <configuration>
              <fail>false</fail>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <snyk-maven-plugin.version>1.1.1</snyk-maven-plugin.version>
      </properties>
    </profile>
    <profile>
      <id>run-its</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>${maven-invoker-plugin.version}</version>
            <executions>
              <execution>
                <id>invoker-install</id>
                <goals>
                  <goal>install</goal>
                </goals>
                <configuration>
                  <extraArtifacts>
                    <extraArtifact>org.apache.maven.plugins:maven-antrun-plugin:1.3:maven-plugin</extraArtifact>
                  </extraArtifacts>
                </configuration>
              </execution>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <debug>false</debug>
              <cloneProjectsTo>${it.directory}/it</cloneProjectsTo>
              <cloneAllFiles>true</cloneAllFiles>
              <setupIncludes>
                <setupInclude>issues/*-pre/pom.xml</setupInclude>
                <setupInclude>*-pre/pom.xml</setupInclude>
              </setupIncludes>
              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
                <pomInclude>issues/*/pom.xml</pomInclude>
              </pomIncludes>
              <pomExcludes>
                <pomExclude>pom-non-qualifier-branches-list-on-feature-it/pom.xml</pomExclude>
                <pomExclude>pom-non-qualifier-branches-single-on-feature-it/pom.xml</pomExclude>
                <pomExclude>issues/issue-36.1/pom.xml</pomExclude>
              </pomExcludes>
              <mavenOpts>-Dmaven.colors.skip=true</mavenOpts>
              <postBuildHookScript>verify</postBuildHookScript>
              <localRepositoryPath>${it.directory}/local-repo</localRepositoryPath>
              <settingsFile>src/it/settings.xml</settingsFile>
              <goals>
                <goal>install</goal>
              </goals>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>changelog</id>
      <activation />
      <build>
        <plugins>
          <plugin>
            <groupId>se.bjurr.gitchangelog</groupId>
            <artifactId>git-changelog-maven-plugin</artifactId>
            <version>1.49</version>
            <executions>
              <execution>
                <id>GenerateGitChangelog</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>git-changelog</goal>
                </goals>
                <configuration>
                  <filePath>CHANGELOG.md</filePath>
                  <templateFile>src/doc/changelog.mustache</templateFile>
                  <gitHubApi>https://api.github.com/repos/jgitver/jgitver-maven-plugin</gitHubApi>
                  <ignoreCommitsWithoutIssue>true</ignoreCommitsWithoutIssue>
                </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>[11, 12)</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>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>properties</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <phase>validate</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <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>base_tag_type: ${jgitver.base_tag_type}</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>
                    <echo>base_version: ${jgitver.base_version}</echo>
                    <echo>next_major_version: ${jgitver.next_major_version}</echo>
                    <echo>next_minor_version: ${jgitver.next_minor_version}</echo>
                    <echo>next_patch_version: ${jgitver.next_patch_version}</echo>
                  </tasks>
                </configuration>
              </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>
              </execution>
            </executions>
            <configuration>
              <source>1.8</source>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</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>${nexus-staging-maven-plugin.version}</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>sonatype</id>
      <repositories>
        <repository>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
          </snapshots>
          <id>sonatype</id>
          <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
      </repositories>
    </profile>
  </profiles>
</project>
