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

  <groupId>org.microbean</groupId>
  <artifactId>microbean-pluginmanagement-pom</artifactId>
  <version>11</version>
  <packaging>pom</packaging>

  <parent>
    <groupId>org.microbean</groupId>
    <artifactId>microbean-parent-pom</artifactId>
    <version>10</version>
    <relativePath />
  </parent>

  <name>microBean Plugin Management POM</name>
  <description>${project.name}</description>
  <inceptionYear>2019</inceptionYear>
  <url>https://github.com/microbean/${project.artifactId}/</url>

  <scm>
    <connection>scm:git:git@github.com:microbean/${project.artifactId}.git</connection>
    <developerConnection>scm:git:git@github.com:microbean/${project.artifactId}.git</developerConnection>
    <url>https://github.com/microbean/${project.artifactId}/</url>
    <tag>v11</tag>
  </scm>

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

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.8</version>
        </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.1.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <compilerArgs>
              <arg>-Xlint:all</arg>
              <arg>-parameters</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.1.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0-M2</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.1.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>3.6.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-toolchains-plugin</artifactId>
          <version>1.1</version>
        </plugin>
        <plugin>
          <groupId>com.github.github</groupId>
          <artifactId>site-maven-plugin</artifactId>
          <version>0.12</version>
          <dependencies>
            <dependency>
              <groupId>org.eclipse.mylyn.github</groupId>
              <artifactId>org.eclipse.egit.github.core</artifactId>
              <version>2.1.5</version>
            </dependency>
          </dependencies>
          <configuration>
            <message>Building site for ${project.artifactId} ${project.version}</message>
          </configuration>
          <executions>
            <execution>
              <id>Deploy site to Github</id>
              <goals>
                <goal>site</goal>
              </goals>
              <phase>site-deploy</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.github.spotbugs</groupId>
          <artifactId>spotbugs-maven-plugin</artifactId>
          <version>3.1.11</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.7</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>

      <resource>
        <targetPath>META-INF</targetPath>
        <directory>${project.basedir}</directory>
        <includes>
          <include>LICENSE</include>
        </includes>
      </resource>
    </resources>
  </build>

  <properties>

    <!-- maven-compiler-plugin properties -->
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>

    <!-- maven-javadoc-plugin properties -->
    <bottom><![CDATA[Copyright &copy; ${project.inceptionYear}&ndash;{currentYear}, <a href="${project.organization.url}" target="_parent">${project.organization.name}</a>. All rights reserved.]]></bottom>
    <detectLinks>false</detectLinks>
    <doctitle>&lt;a href="${project.url}" target="_parent"&gt;&lt;span style="font-family:Lobster, cursive;"&gt;µb&lt;/span&gt; ${project.artifactId}&lt;/a&gt; ${project.version} &lt;a href="${ciUrl}" target="_parent"&gt;&lt;img src="${ciBadge}"&gt;&lt;/a&gt;</doctitle>
    <sourcetab>2</sourcetab>

    <!-- maven-release-plugin properties; see http://maven.apache.org/maven-release/maven-release-plugin/ -->
    <goals>deploy,site-deploy</goals>
    <scmCommentPrefix>[maven-release-plugin] [skip ci]</scmCommentPrefix>
    <tagNameFormat>v@{project.version}</tagNameFormat>

    <!-- maven-site-plugin properties -->
    <maven.site.deploy.skip>true</maven.site.deploy.skip>
    <relativizeDecorationLinks>false</relativizeDecorationLinks>

    <!-- maven-surefire-plugin properties -->
    <surefire.useFile>false</surefire.useFile>
    <trimStackTrace>false</trimStackTrace>

    <!-- site-github-plugin properties -->
    <github.global.server>github</github.global.server>

    <!-- spotbugs-maven-plugin properties; see https://spotbugs.github.io/spotbugs-maven-plugin/spotbugs-mojo.html -->
    <spotbugs.excludeFilterFile>src/spotbugs/exclude.xml</spotbugs.excludeFilterFile>

    <!-- CI/CD-related properties -->
    <ciUrl>https://travis-ci.com/microbean/${project.artifactId}</ciUrl>
    <ciBadge>${ciUrl}.svg?branch=master</ciBadge>

  </properties>

  <profiles>
    <profile>
      <id>spotbugs</id>
      <activation>
        <file>
          <exists>${spotbugs.excludeFilterFile}</exists>
        </file>
      </activation>
      <properties>
        <!-- spotbugs-maven-plugin properties; see https://spotbugs.github.io/spotbugs-maven-plugin/spotbugs-mojo.html -->
        <spotbugs.effort>Max</spotbugs.effort>
        <spotbugs.threshold>Medium</spotbugs.threshold>
      </properties>
      <reporting>
        <plugins>
          <plugin>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </reporting>
    </profile>

    <profile>
      <id>toolchain</id>
      <activation>
        <file>
          <exists>${user.home}/.m2/toolchains.xml</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-toolchains-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>toolchain</goal>
                </goals>
                <configuration>
                  <toolchains>
                    <jdk>
                      <version>${jdkToolchainVersion}</version>
                    </jdk>
                  </toolchains>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <properties>
        <!-- Properties related to maven-toolchains-plugin -->
        <jdkToolchainVersion>${maven.compiler.target}</jdkToolchainVersion>
      </properties>
    </profile>
  </profiles>

</project>
