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

  <parent>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>mojo-parent</artifactId>
    <version>38</version>
  </parent>

  <artifactId>buildnumber-maven-plugin</artifactId>
  <version>1.4</version>
  <packaging>maven-plugin</packaging>

  <name>Build Number Maven Plugin</name>
  <description>
     This plugin is designed to give you a build number. So when you might make 100 builds of version
     1.0-SNAPSHOT, you can differentiate between them all.
  </description>
  <inceptionYear>2007</inceptionYear>
  <licenses>
    <license>
      <name>The MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>woodj</id>
      <name>Julian Wood</name>
      <email>woodj@ucalgary.ca</email>
      <organization>Learning Commons, University of Calgary</organization>
      <organizationUrl>http://commons.ucalgary.ca</organizationUrl>
      <roles>
        <role>Programmer</role>
      </roles>
    </developer>
    <developer>
      <id>olamy</id>
      <name>Olivier Lamy</name>
      <email>olamy@apache.org</email>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>bimargulies</id>
      <name>Benson Margulies</name>
      <email>bimargulies@apache.org</email>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
  </developers>

  <prerequisites>
    <maven>2.2.1</maven>
  </prerequisites>

  <scm>
    <connection>scm:git:https://github.com/mojohaus/buildnumber-maven-plugin.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/mojohaus/buildnumber-maven-plugin.git</developerConnection>
    <url>https://github.com/mojohaus/buildnumber-maven-plugin</url>
    <tag>buildnumber-maven-plugin-1.4</tag>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/mojohaus/buildnumber-maven-plugin/issues</url>
  </issueManagement>

  <properties>
    <maven.scm.version>1.9.4</maven.scm.version>
    <maven.api.version>2.2.1</maven.api.version>
    <mojo.java.target>1.5</mojo.java.target>
    <maven.it.version>3.1.1</maven.it.version>
    <takari.plugin.testing.version>2.1.0</takari.plugin.testing.version>
    <test.excludes>**/it/**</test.excludes>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>${maven.api.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-settings</artifactId>
      <version>${maven.api.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven.api.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven.api.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.scm</groupId>
      <artifactId>maven-scm-api</artifactId>
      <version>${maven.scm.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.scm</groupId>
      <artifactId>maven-scm-manager-plexus</artifactId>
      <version>${maven.scm.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.scm</groupId>
      <artifactId>maven-scm-provider-bazaar</artifactId>
      <version>${maven.scm.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.scm</groupId>
      <artifactId>maven-scm-provider-svnexe</artifactId>
      <version>${maven.scm.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.scm</groupId>
      <artifactId>maven-scm-provider-gitexe</artifactId>
      <version>${maven.scm.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.scm</groupId>
      <artifactId>maven-scm-provider-svn-commons</artifactId>
      <version>${maven.scm.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.scm</groupId>
      <artifactId>maven-scm-provider-cvsexe</artifactId>
      <version>${maven.scm.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.scm</groupId>
      <artifactId>maven-scm-provider-starteam</artifactId>
      <version>${maven.scm.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.scm</groupId>
      <artifactId>maven-scm-provider-clearcase</artifactId>
      <version>${maven.scm.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.scm</groupId>
      <artifactId>maven-scm-provider-perforce</artifactId>
      <version>${maven.scm.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.scm</groupId>
      <artifactId>maven-scm-provider-hg</artifactId>
      <version>${maven.scm.version}</version>
    </dependency>

    <dependency>
      <groupId>com.google.code.maven-scm-provider-svnjava</groupId>
      <artifactId>maven-scm-provider-svnjava</artifactId>
      <version>2.1.1</version>
      <exclusions>
        <!-- this plugin requires svnkit-1.8.4 but it is not at central -->
        <exclusion>
          <groupId>org.tmatesoft.svnkit</groupId>
          <artifactId>svnkit</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.tmatesoft.svnkit</groupId>
      <artifactId>svnkit</artifactId>
      <version>1.8.5</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>3.0.21</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.4</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.sonatype.plexus</groupId>
      <artifactId>plexus-sec-dispatcher</artifactId>
      <version>1.4</version>
    </dependency>

    <dependency>
      <groupId>io.takari.maven.plugins</groupId>
      <artifactId>takari-plugin-testing</artifactId>
      <version>${takari.plugin.testing.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.takari.maven.plugins</groupId>
      <artifactId>takari-plugin-integration-testing</artifactId>
      <version>${takari.plugin.testing.version}</version>
      <type>pom</type>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <excludes>
              <exclude>${test.excludes}</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>1.10</version>
          <configuration>
            <debug>true</debug>
            <preBuildHookScript>prebuild</preBuildHookScript>
            <postBuildHookScript>verify</postBuildHookScript>
            <localRepositoryPath>${project.build.directory}/local repository</localRepositoryPath>
            <extraArtifacts>
              <extraArtifact>org.apache.maven.plugins:maven-scm-plugin:${maven.scm.version}:maven-plugin</extraArtifact>
            </extraArtifacts>
            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
            <settingsFile>src/it/settings.xml</settingsFile>
            <pomExcludes>
              <!-- Currently not correctly working. -->
              <pomExclude>MBUILDNUM-5/pom.xml</pomExclude>
            </pomExcludes>
          </configuration>
          <executions>
            <execution>
              <id>integration-test</id>
              <goals>
                <goal>install</goal>
                <goal>run</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <configuration>
            <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
          </configuration>
          <executions>
            <execution>
              <id>mojo-descriptor</id>
              <goals>
                <goal>descriptor</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

  </build>

  <profiles>
    <profile>
      <id>run-its</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>1.10</version>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>run-project-its</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <test.excludes />
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack</id>
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}/maven-installation</outputDirectory>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.apache.maven</groupId>
                      <artifactId>apache-maven</artifactId>
                      <version>${maven.it.version}</version>
                      <classifier>bin</classifier>
                      <type>tar.gz</type>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce-versions</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <enforceBytecodeVersion>
                      <maxJdkVersion>${mojo.java.target}</maxJdkVersion>
                      <excludes>
                        <exclude>io.takari.*</exclude>
                        <exclude>org.codehaus.plexus:plexus-classworlds</exclude>
                      </excludes>
                    </enforceBytecodeVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>extra-enforcer-rules</artifactId>
                <version>1.0-beta-3</version>
              </dependency>
            </dependencies>
          </plugin>

          <plugin>
            <groupId>io.takari.maven.plugins</groupId>
            <artifactId>takari-lifecycle-plugin</artifactId>
            <version>1.10.1</version>
            <extensions>true</extensions>
            <executions>
              <execution>
                <id>testProperties</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>testProperties</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>devlocal</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>buildnumber-maven-plugin</artifactId>
            <version>${project.version}</version>
            <executions>
              <execution>
                <id>useLastCommittedRevision</id>
                <phase>compile</phase>
                <goals>
                  <goal>create</goal>
                </goals>
                <configuration>
                  <providerImplementations>
                    <svn>javasvn</svn>
                  </providerImplementations>
                  <useLastCommittedRevision>true</useLastCommittedRevision>
                  <doUpdate>true</doUpdate>
                </configuration>
              </execution>
              <execution>
                <id>timestampFormat</id>
                <phase>test</phase>
                <goals>
                  <goal>create</goal>
                </goals>
                <configuration>
                  <providerImplementations>
                    <svn>javasvn</svn>
                  </providerImplementations>
                  <useLastCommittedRevision>true</useLastCommittedRevision>
                  <timestampFormat>{0,date,yyyy-MM-dd}</timestampFormat>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
