<?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>org.archmix</groupId>
  <artifactId>java-parent</artifactId>
  <version>1.8.2</version>
  <packaging>pom</packaging>

  <name>Archmix Java Parent</name>
  <description>Standardization of Archmix Java Projects</description>
  <url>https://archmix.org</url>

  <properties>
    <javaVersion>1.8</javaVersion>
    <lombokVersion>1.18.6</lombokVersion>
    <junitVersion>4.11</junitVersion>
    <mockitoVersion>1.10.8</mockitoVersion>
    <sl4jVersion>1.7.21</sl4jVersion>

    <maven.failsafe.pluginVersion>2.18.1</maven.failsafe.pluginVersion>
    <maven.javadoc.pluginVersion>2.10.1</maven.javadoc.pluginVersion>
    <maven.surefire.pluginVersion>3.0.0-M3</maven.surefire.pluginVersion>
    <maven.compiler.pluginVersion>3.2</maven.compiler.pluginVersion>
    <maven.resources.pluginVersion>2.7</maven.resources.pluginVersion>
    <maven.dependency.pluginVersion>2.10</maven.dependency.pluginVersion>
    <maven.relase.pluginVersion>2.5.3</maven.relase.pluginVersion>
    <maven.source.pluginVersion>3.2.0</maven.source.pluginVersion>

    <maven.gpg.pluginVersion>1.5</maven.gpg.pluginVersion>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- LOMBOK -->
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${lombokVersion}</version>
      </dependency>

      <!-- Slf4j Api -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${sl4jVersion}</version>
      </dependency>

      <!-- TEST -->
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockitoVersion}</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junitVersion}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven.compiler.pluginVersion}</version>
        <configuration>
          <source>${javaVersion}</source>
          <target>${javaVersion}</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${maven.resources.pluginVersion}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${maven.dependency.pluginVersion}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven.surefire.pluginVersion}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${maven.failsafe.pluginVersion}</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven.surefire.pluginVersion}</version>
            <configuration>
              <skipTests>true</skipTests>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>${maven.relase.pluginVersion}</version>
            <configuration>
              <allowTimestampedSnapshots>true</allowTimestampedSnapshots>
              <autoVersionSubmodules>true</autoVersionSubmodules>
              <remoteTagging>false</remoteTagging>
              <scmCommentPrefix>[skip ci]</scmCommentPrefix>
              <tagNameFormat>v@{project.version}</tagNameFormat>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven.gpg.pluginVersion}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven.source.pluginVersion}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven.javadoc.pluginVersion}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <scm>
    <connection>scm:git:ssh://github.com/archmix/${project.artifactId}.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/archmix/${project.artifactId}.git</developerConnection>
    <url>https://github.com/archmix/${project.artifactId}</url>
    <tag>v1.8.2</tag>
  </scm>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <issueManagement>
    <system>Github issue tracker</system>
    <url>https://github.com/archmix/${project.artifactId}/issues</url>
  </issueManagement>

  <developers>
    <developer>
      <id>mrbraz</id>
      <name>Anderson Braz</name>
      <email>mrbraz@archmix.org</email>
    </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>
</project>