<?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.github.nhirakawa</groupId>
  <artifactId>basepom</artifactId>
  <version>6.0</version>

  <packaging>pom</packaging>

  <name>basepom</name>

  <description>basepom for my personal projects</description>

  <properties>
    <enforcer.skip>true</enforcer.skip>
    <java.compiler.version>1.8</java.compiler.version>
    <maven.compiler.plugin.version>3.7.0</maven.compiler.plugin.version>
    <maven.dependency.plugin.phase>verify</maven.dependency.plugin.phase>
    <maven.dependency.plugin.version>3.1.1</maven.dependency.plugin.version>
    <maven.enforcer.plugin.phase>verify</maven.enforcer.plugin.phase>
    <maven.enforcer.plugin.version>3.0.0-M3</maven.enforcer.plugin.version>
    <maven.gpg.plugin.version>1.5</maven.gpg.plugin.version>
    <maven.help.plugin.version>3.2.0</maven.help.plugin.version>
    <maven.javadoc.plugin.version>2.9.1</maven.javadoc.plugin.version>
    <maven.release.plugin.version>2.5.3</maven.release.plugin.version>
    <maven.source.plugin.version>2.2.1</maven.source.plugin.version>
    <nexus.staging.maven.plugin.version>1.6.7</nexus.staging.maven.plugin.version>
    <prettier.fail>true</prettier.fail>
    <prettier.skip>true</prettier.skip>
    <prettier.version>0.5</prettier.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <sortpom.maven.plugin.phase>verify</sortpom.maven.plugin.phase>
    <sortpom.maven.plugin.version>2.8.0</sortpom.maven.plugin.version>
    <versions.maven.plugin.version>2.7</versions.maven.plugin.version>
  </properties>

  <build>
    <plugins>
      <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>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${maven.release.plugin.version}</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <goals>deploy</goals>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven.compiler.plugin.version}</version>
        <configuration>
          <source>${java.compiler.version}</source>
          <target>${java.compiler.version}</target>
          <showWarnings>true</showWarnings>
          <compilerArgs>
            <art>-Xlint</art>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${maven.dependency.plugin.version}</version>
        <executions>
          <execution>
            <id>analyze</id>
            <goals>
              <goal>analyze-only</goal>
            </goals>
            <phase>${maven.dependency.plugin.phase}</phase>
            <configuration>
              <failOnWarning>true</failOnWarning>
              <ignoreNonCompile>true</ignoreNonCompile>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.ekryd.sortpom</groupId>
        <artifactId>sortpom-maven-plugin</artifactId>
        <version>${sortpom.maven.plugin.version}</version>
        <configuration>
          <predefinedSortOrder>custom_1</predefinedSortOrder>
          <lineSeparator>\n</lineSeparator>
          <encoding>${project.build.sourceEncoding}</encoding>
          <sortProperties>true</sortProperties>
          <keepBlankLines>true</keepBlankLines>
          <sortDependencies>scope,groupId,artifactId</sortDependencies>
          <createBackupFile>false</createBackupFile>
          <verifyFail>Stop</verifyFail>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>verify</goal>
            </goals>
            <phase>${sortpom.maven.plugin.phase}</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-help-plugin</artifactId>
        <version>${maven.help.plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven.enforcer.plugin.version}</version>
        <executions>
          <execution>
            <id>enforce</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <phase>${maven.enforcer.plugin.phase}</phase>
            <configuration>
              <rules>
                <banDuplicatePomDependencyVersions />
                <banTransitiveDependencies />
                <dependencyConvergance />
                <reactorModuleConvergence />
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <version>${versions.maven.plugin.version}</version>
      </plugin>
    </plugins>
  </build>

  <url>https://github.com/nhirakawa/basepom</url>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>nhirakawa</id>
      <name>Nick Hirakawa</name>
      <email>nickhirakawa@gmail.com</email>
      <url>https://github.com/nhirakawa</url>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:ssh://git@github.com/nhirakawa/basepom</connection>
    <developerConnection>scm:git:ssh://git@github.com/nhirakawa/basepom</developerConnection>
    <url>https://github.com/nhirakawa/basepom</url>
    <tag>basepom-6.0</tag>
  </scm>

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

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven.source.plugin.version}</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.plugin.version}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven.gpg.plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>travis</id>
      <activation>
        <property>
          <name>env.TRAVIS</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.hubspot.maven.plugins</groupId>
            <artifactId>prettier-maven-plugin</artifactId>
            <version>${prettier.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
                <phase>validate</phase>
                <configuration>
                  <skip>${prettier.skip}</skip>
                  <fail>${prettier.fail}</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>local</id>
      <activation>
        <property>
          <name>!env.TRAVIS</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.hubspot.maven.plugins</groupId>
            <artifactId>prettier-maven-plugin</artifactId>
            <version>${prettier.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>write</goal>
                </goals>
                <phase>validate</phase>
                <configuration>
                  <skip>${prettier.skip}</skip>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
