<?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>
  <groupId>com.lesfurets</groupId>
  <artifactId>partial-build-plugin</artifactId>
  <version>2.6</version>
  <packaging>maven-plugin</packaging>
  <name>${project.groupId}:${project.artifactId}</name>
  <description>
    A maven plugin for partially building multi-module projects based on changes in the Git repository.
  </description>
  <url>https://github.com/lesfurets/partial-build-plugin</url>
  <issueManagement>
    <url>https://github.com/lesfurets/partial-build-plugin/issues</url>
    <system>GitHub Issues</system>
  </issueManagement>
  <scm>
    <url>https://github.com/lesfurets/partial-build-plugin</url>
    <connection>scm:git:git://github.com/lesfurets/partial-build-plugin.git</connection>
    <developerConnection>scm:git:git@github.com/lesfurets/partial-build-plugin.git</developerConnection>
  </scm>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <email>ozangunalp@gmail.com</email>
      <name>Ozan Gunalp</name>
      <url>https://github.com/ozangunalp</url>
      <id>ozangunalp</id>
      <organization>lesfurets.com</organization>
      <organizationUrl>https://github.com/lesfurets</organizationUrl>
    </developer>
    <developer>
      <name>Alexandre Dubreuil</name>
      <url>https://github.com/dubreuia</url>
      <id>dubreuia</id>
      <organization>lesfurets.com</organization>
      <organizationUrl>https://github.com/lesfurets</organizationUrl>
    </developer>
    <developer>
      <name>Vaclav Kosar</name>
      <url>https://github.com/vackosar</url>
      <id>vackosar</id>
    </developer>
  </developers>
  <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>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <!-- Dependency versions -->
    <jgit.version>4.4.1.201607150455-r</jgit.version>
    <guice.version>4.0</guice.version>
    <maven-core.version>3.3.9</maven-core.version>
    <maven-common-artifact-filters.version>1.4</maven-common-artifact-filters.version>
    <plexus-component-annotations.version>1.5.5</plexus-component-annotations.version>
    <maven-plugin-annotations.version>3.4</maven-plugin-annotations.version>
    <junit.version>4.11</junit.version>
    <mockito-all.version>1.8.4</mockito-all.version>
    <assertj-core.version>3.4.1</assertj-core.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit</artifactId>
      <version>${jgit.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <version>${guice.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven-core.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-common-artifact-filters</artifactId>
      <version>${maven-common-artifact-filters.version}</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-component-annotations</artifactId>
      <version>${plexus-component-annotations.version}</version>
      <exclusions>
        <exclusion>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
        </exclusion>
      </exclusions>
    </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>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>${mockito-all.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj-core.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>2.0.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.7</version>
        </plugin>
        <plugin>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>3.4</version>
        </plugin>
        <plugin>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.6</version>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.9.1</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-component-metadata</artifactId>
          <version>1.6</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.7</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <defaultGoal>clean install</defaultGoal>
    <resources>
      <resource>
        <directory>${basedir}</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>LICENSE.txt</include>
        </includes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <additionalClasspathElements>
            <additionalClasspathElement>
              src/it
            </additionalClasspathElement>
          </additionalClasspathElements>
          <workingDirectory>${project.build.directory}</workingDirectory>
          <systemPropertyVariables>
            <projectVersion>${project.version}</projectVersion>
            <buildDir>${project.build.directory}</buildDir>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-invoker-plugin</artifactId>
        <configuration>
          <setupIncludes>
            <setupInclude>install-all/pom.xml</setupInclude>
          </setupIncludes>
          <pomIncludes>
            <pomInclude>*/pom.xml</pomInclude>
          </pomIncludes>
          <skipInvocation>${skipTests}</skipInvocation>
          <addTestClassPath>true</addTestClassPath>
          <preBuildHookScript>setup</preBuildHookScript>
          <postBuildHookScript>verify</postBuildHookScript>
          <scriptVariables>
            <sourceDir>${project.basedir}</sourceDir>
            <projectVersion>${project.version}</projectVersion>
          </scriptVariables>
          <projectsDirectory>src/it/projects</projectsDirectory>
          <cloneProjectsTo>${project.build.directory}/it/projects</cloneProjectsTo>
          <cloneAllFiles>true</cloneAllFiles>
          <settingsFile>src/it/settings.xml</settingsFile>
          <localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
        </configuration>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-metadata</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
        <configuration>
          <goalPrefix>partial</goalPrefix>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <execution>
            <id>help-goal</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>ossrh</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <useAgent>true</useAgent>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <encoding>${project.build.sourceEncoding}</encoding>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>