<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>

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>6</version>
  </parent>

  <groupId>pl.project13.maven</groupId>
  <artifactId>git-commit-id-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <version>2.1.11</version>
  <name>Git Commit Id Plugin Maven Mojo</name>
  <description>
    git-commit-id-plugin is a plugin quite similar to
    https://fisheye.codehaus.org/browse/mojo/tags/buildnumber-maven-plugin-1.0-beta-4 for example but as buildnumber at
    the time when I started this plugin only supported CVS and SVN, something had to be done.
    This plugin makes basic repository information available through maven resources. This can be used to display
    "what version is this?" or "who has deployed this and when, from which branch?" information at runtime - making
    it easy to find things like "oh, that isn't deployed yet, I'll test it tomorrow" and making both testers and
    developers life easier.

    The data currently exported is like this (that's the end effect from the GitRepositoryState Bean):
    {
    "branch" : "testing-maven-git-plugin",
    "commitTime" : "06.01.1970 @ 16:16:26 CET",
    "commitId" : "787e39f61f99110e74deed68ab9093088d64b969",
    "commitUserName" : "Konrad Malawski",
    "commitUserEmail" : "konrad.malawski@java.pl",
    "commitMessageFull" : "releasing my fun plugin :-) + fixed some typos + cleaned up directory structure + added
    license etc",
    "commitMessageShort" : "releasing my fun plugin :-)",
    "buildTime" : "06.01.1970 @ 16:17:53 CET",
    "buildUserName" : "Konrad Malawski",
    "buildUserEmail" : "konrad.malawski@java.pl"
    }

    Note that the data is exported via maven resource filtering and is really easy to use with spring -
    which I've explained in detail in this readme https://github.com/ktoso/maven-git-commit-id-plugin
  </description>
  <url>http://www.blog.project13.pl</url>

  <developers>
    <developer>
      <id>ktoso</id>
      <name>Konrad Malawski</name>
      <email>konrad.malawski@java.pl</email>
      <organization>project13.pl</organization>
      <url>http://blog.project13.pl</url>
    </developer>
  </developers>

  <prerequisites>
    <maven>[${maven-plugin-api.version},)</maven>
  </prerequisites>

  <licenses>
    <license>
      <name>GNU Lesser General Public License 3.0</name>
      <url>http://www.gnu.org/licenses/lgpl-3.0.txt</url>
    </license>
  </licenses>

  <scm>
    <url>git@github.com/ktoso/maven-git-commit-id-plugin.git</url>
    <connection>scm:git:https://github.com/ktoso/maven-git-commit-id-plugin</connection>
    <developerConnection>scm:git:git@github.com:ktoso/maven-git-commit-id-plugin.git</developerConnection>
  </scm>

  <properties>
    <maven-plugin-api.version>2.2.1</maven-plugin-api.version>

    <jgit.version>3.4.1.201406201815-r</jgit.version>
    <junit.version>4.10</junit.version>
    <mockito.version>1.9.0</mockito.version>

    <java.target>1.6</java.target>
    <sourceEncoding>UTF-8</sourceEncoding>
    <outputEncoding>UTF-8</outputEncoding>
    <fest-assert.version>1.4</fest-assert.version>
  </properties>

  <dependencies>
    <!-- MAVEN -->
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven-plugin-api.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>${maven-plugin-api.version}</version>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.2.3</version>
    </dependency>

    <!-- Joda Time -->
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>2.0</version>
    </dependency>

    <!-- Guava -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>15.0</version>
    </dependency>

    <!-- IntelliJ Annotations -->
    <dependency>
      <groupId>com.intellij</groupId>
      <artifactId>annotations</artifactId>
      <version>9.0.4</version>
    </dependency>

    <!-- JGit -->

    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit</artifactId>
      <version>${jgit.version}</version>
    </dependency>

    <!-- Test stuff -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.easytesting</groupId>
      <artifactId>fest-assert</artifactId>
      <version>${fest-assert.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>2.0.5</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>1.3.2</version>
      <type>jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>pl.pragmatists</groupId>
      <artifactId>JUnitParams</artifactId>
      <version>1.0.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <!-- GIT COMMIT ID PLUGIN CONFIGURATION -->
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*.properties</include>
          <include>**/*.xml</include>
        </includes>
      </resource>
    </resources>

    <plugins>
      <!--<plugin>-->
        <!--<groupId>pl.project13.maven</groupId>-->
        <!--<artifactId>git-commit-id-plugin</artifactId>-->
        <!--<version>${project.version}</version>-->
        <!--<executions>-->
          <!--<execution>-->
            <!--<goals>-->
              <!--<goal>revision</goal>-->
            <!--</goals>-->
          <!--</execution>-->
        <!--</executions>-->
        <!--<configuration>-->
          <!--<verbose>true</verbose>-->
          <!--<skip>false</skip>-->
          <!--<prefix>git</prefix>-->
          <!--<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>-->
          <!--<generateGitPropertiesFile>true</generateGitPropertiesFile>-->
          <!--<generateGitPropertiesFilename>target/testing.properties</generateGitPropertiesFilename>-->

          <!--<dateFormat>dd.MM.yyyy '@' HH:mm:ss z</dateFormat>-->
          <!--<useNativeGit>false</useNativeGit>-->
          <!--<abbrevLength>7</abbrevLength>-->
          <!--<format>properties</format>-->

          <!--<gitDescribe>-->
            <!--<skip>false</skip>-->
            <!--<always>false</always>-->
            <!--<abbrev>7</abbrev>-->
            <!--<dirty>-DEVEL</dirty>-->
            <!--<forceLongFormat>false</forceLongFormat>-->
          <!--</gitDescribe>-->

          <!--<excludeProperties>-->
            <!--<excludeProperty>git.commit.*</excludeProperty>-->
            <!--<excludeProperty>git.remote.origin.url</excludeProperty>-->
          <!--</excludeProperties>-->

          <!--<failOnNoGitDirectory>true</failOnNoGitDirectory>-->
          <!--<failOnUnableToExtractRepoInfo>true</failOnUnableToExtractRepoInfo>-->
        <!--</configuration>-->
      <!--</plugin>-->
      <!-- Setting built-in java compiler properties -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
          <encoding>UTF-8</encoding>
          <source>${java.target}</source>
          <target>${java.target}</target>
        </configuration>
      </plugin>

      <!--<plugin>-->
        <!--<artifactId>maven-plugin-plugin</artifactId>-->
        <!--<version>${maven-plugin-api.version}</version>-->
        <!--<executions>-->
          <!--<execution>-->
            <!--<id>generated-helpmojo</id>-->
            <!--<goals>-->
              <!--<goal>helpmojo</goal>-->
            <!--</goals>-->
            <!--<configuration>-->
              <!--<goalPrefix>git-commit-id</goalPrefix>-->
              <!--<helpPackageName>pl.project13.maven</helpPackageName>-->
            <!--</configuration>-->
          <!--</execution>-->
        <!--</executions>-->
      <!--</plugin>-->
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>gpg</id>
      <build>
        <plugins>
          <!-- GPG -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>

