<?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"
  child.project.url.inherit.append.path="false">

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.io7m.primogenitor</groupId>
  <artifactId>com.io7m.primogenitor</artifactId>
  <version>7.7.0</version>
  <packaging>pom</packaging>

  <modules>
    <module>com.io7m.primogenitor.lite</module>
    <module>com.io7m.primogenitor.full</module>
    <module>com.io7m.primogenitor.support</module>
    <module>com.io7m.primogenitor.tests</module>
  </modules>

  <name>com.io7m.primogenitor</name>
  <description>The initial ancestor pom for io7m.com projects</description>
  <url>https://www.io7m.com/</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- The version of the JDK required to _build_ the code. -->
    <io7m.java.requiredSDKBuildVersion>[17,21)</io7m.java.requiredSDKBuildVersion>

    <!-- The version of Java targeted by the code. -->
    <io7m.java.targetJavaVersion>17</io7m.java.targetJavaVersion>

    <!-- The groupId of the artifact that contains checkstyle rules for the project. -->
    <io7m.checkstyle.groupId>com.io7m.checkstyle_rules</io7m.checkstyle.groupId>

    <!-- The artifact that contains checkstyle rules for the project. -->
    <io7m.checkstyle.artifact>com.io7m.checkstyle_rules</io7m.checkstyle.artifact>

    <!-- The version of the artifact that contains checkstyle rules for the project. -->
    <io7m.checkstyle.version>1.2.0</io7m.checkstyle.version>

    <!-- The path to the checkstyle configuration inside the checkstyle package. -->
    <io7m.checkstyle.path>com/io7m/checkstyle_rules/checkstyle.xml</io7m.checkstyle.path>

    <!-- The version of the checkstyle tools used -->
    <io7m.checkstyle.tools.version>10.11.0</io7m.checkstyle.tools.version>

    <!-- The previous groupId of the API. Used to enforce semantic versioning. -->
    <io7m.api.previousGroupId>${project.groupId}</io7m.api.previousGroupId>

    <!-- The previous artifactId of the API. Used to enforce semantic versioning. -->
    <io7m.api.previousArtifactId>${project.artifactId}</io7m.api.previousArtifactId>

    <!-- The previous version of the API. Used to enforce semantic versioning. -->
    <io7m.api.previousVersion/>

    <!-- The default doclint configuration to use for JavaDoc (may be empty) -->
    <io7m.javadoc.docLint>-Xdoclint:all</io7m.javadoc.docLint>

    <!-- The timestamp used for all outputs, for reproducibility. -->
    <project.build.outputTimestamp>2023-05-18T16:43:44Z</project.build.outputTimestamp>

    <!-- The versions of all plugins used -->
    <io7m.bnd-baseline-maven-plugin.version>6.4.0</io7m.bnd-baseline-maven-plugin.version>
    <io7m.bnd-export-maven-plugin.version>6.4.0</io7m.bnd-export-maven-plugin.version>
    <io7m.bnd-indexer-maven-plugin.version>6.4.0</io7m.bnd-indexer-maven-plugin.version>
    <io7m.bnd-maven-plugin.version>6.4.0</io7m.bnd-maven-plugin.version>
    <io7m.bnd-resolver-maven-plugin.version>6.4.0</io7m.bnd-resolver-maven-plugin.version>
    <io7m.bnd.plugins.version>6.2.0</io7m.bnd.plugins.version>
    <io7m.build-helper-maven-plugin.version>3.4.0</io7m.build-helper-maven-plugin.version>
    <io7m.buildnumber-maven-plugin.version>3.1.0</io7m.buildnumber-maven-plugin.version>
    <io7m.checksum-maven-plugin.version>1.11</io7m.checksum-maven-plugin.version>
    <io7m.exec-maven-plugin.version>3.1.0</io7m.exec-maven-plugin.version>
    <io7m.extra-enforcer-rules.version>1.6.2</io7m.extra-enforcer-rules.version>
    <io7m.fb-contrib-plugin.version>7.4.0.sb</io7m.fb-contrib-plugin.version>
    <io7m.findsecbugs-plugin.version>1.7.1</io7m.findsecbugs-plugin.version>
    <io7m.jacoco-maven-plugin.version>0.8.10</io7m.jacoco-maven-plugin.version>
    <io7m.maven-assembly-plugin.version>3.6.0</io7m.maven-assembly-plugin.version>
    <io7m.maven-bundle-plugin.version>3.5.0</io7m.maven-bundle-plugin.version>
    <io7m.maven-checkstyle-plugin.version>3.2.2</io7m.maven-checkstyle-plugin.version>
    <io7m.maven-clean-plugin.version>3.2.0</io7m.maven-clean-plugin.version>
    <io7m.maven-compiler-plugin.version>3.11.0</io7m.maven-compiler-plugin.version>
    <io7m.maven-dependency-plugin.version>3.5.0</io7m.maven-dependency-plugin.version>
    <io7m.maven-deploy-plugin.version>3.1.1</io7m.maven-deploy-plugin.version>
    <io7m.maven-enforcer-plugin.version>3.3.0</io7m.maven-enforcer-plugin.version>
    <io7m.maven-failsafe-plugin.version>3.1.0</io7m.maven-failsafe-plugin.version>
    <io7m.maven-gpg-plugin.version>3.1.0</io7m.maven-gpg-plugin.version>
    <io7m.maven-install-plugin.version>3.1.1</io7m.maven-install-plugin.version>
    <io7m.maven-jar-plugin.version>3.3.0</io7m.maven-jar-plugin.version>
    <io7m.maven-javadoc-plugin.version>3.5.0</io7m.maven-javadoc-plugin.version>
    <io7m.maven-resources-plugin.version>3.3.1</io7m.maven-resources-plugin.version>
    <io7m.maven-shade-plugin.version>3.4.1</io7m.maven-shade-plugin.version>
    <io7m.maven-site-plugin.version>4.0.0-M3</io7m.maven-site-plugin.version>
    <io7m.maven-source-plugin.version>3.2.1</io7m.maven-source-plugin.version>
    <io7m.maven-surefire-plugin.version>3.1.0</io7m.maven-surefire-plugin.version>
    <io7m.nexus-staging-maven-plugin.version>1.6.13</io7m.nexus-staging-maven-plugin.version>
    <io7m.reproducible-build-maven-plugin.version>0.16</io7m.reproducible-build-maven-plugin.version>
    <io7m.scijava-maven-plugin.version>2.2.0</io7m.scijava-maven-plugin.version>
    <io7m.spotbugs-maven-plugin.version>4.7.3.4</io7m.spotbugs-maven-plugin.version>
    <io7m.truezip-maven-plugin.version>1.2</io7m.truezip-maven-plugin.version>

    <!-- Strings that appear in jars -->
    <io7m.jar.vendor>io7m.com</io7m.jar.vendor>
    <io7m.jar.built_by>io7m</io7m.jar.built_by>
  </properties>

  <inceptionYear>2017</inceptionYear>

  <licenses>
    <license>
      <name>ISC</name>
      <url>https://io7m.com/license/isc.txt</url>
    </license>
  </licenses>

  <scm child.scm.connection.inherit.append.path="false"
       child.scm.developerConnection.inherit.append.path="false"
       child.scm.url.inherit.append.path="false">
    <url>https://github.com/io7m/primogenitor</url>
    <connection>scm:git:https://github.com/io7m/primogenitor</connection>
    <developerConnection>scm:git:https://github.com/io7m/primogenitor</developerConnection>
  </scm>

  <developers>
    <developer>
      <id>io7m</id>
      <name>io7m</name>
      <email>code@io7m.com</email>
      <url>https://io7m.com</url>
    </developer>
  </developers>

  <issueManagement>
    <url>https://github.com/io7m/primogenitor/issues</url>
    <system>GitHub Issues</system>
  </issueManagement>

  <distributionManagement>
    <site child.site.url.inherit.append.path="false">
      <id>io7m.com</id>
      <name>io7m.com</name>
      <url>https://www.io7m.com/software/primogenitor</url>
    </site>
    <repository>
      <id>sonatype-nexus-staging</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

  <ciManagement>
    <system>GitHub Actions</system>
    <url>https://github.com/primogenitor/actions</url>
  </ciManagement>

  <prerequisites>
    <maven>3.6.2</maven>
  </prerequisites>

  <build>
    <pluginManagement>
      <plugins>

        <!--
          Well-known core plugins used everywhere.
        -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${io7m.maven-clean-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${io7m.maven-deploy-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>${io7m.maven-install-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${io7m.maven-resources-plugin.version}</version>
        </plugin>

        <!--
          Compiler plugin.

          https://maven.apache.org/plugins/maven-compiler-plugin/
        -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${io7m.maven-compiler-plugin.version}</version>
          <configuration>
            <source>${io7m.java.targetJavaVersion}</source>
            <target>${io7m.java.targetJavaVersion}</target>
            <release>${io7m.java.targetJavaVersion}</release>
          </configuration>
        </plugin>

        <!--
          Site plugin.
          https://maven.apache.org/plugins/maven-site-plugin/
        -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>${io7m.maven-site-plugin.version}</version>
        </plugin>

        <!--
          Surefire plugin.
          https://maven.apache.org/surefire/maven-surefire-plugin/

          Used to execute unit tests.
        -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${io7m.maven-surefire-plugin.version}</version>
          <configuration>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
          </configuration>
        </plugin>

        <!--
          Failsafe plugin.
          https://maven.apache.org/surefire/maven-failsafe-plugin/

          Used to execute integration tests.
        -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${io7m.maven-failsafe-plugin.version}</version>
          <configuration>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
          </configuration>
        </plugin>

        <!--
          Assembly plugin.
          https://maven.apache.org/plugins/maven-assembly-plugin/

          Used to produce archives of documentation, code, etc.
        -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>${io7m.maven-assembly-plugin.version}</version>
        </plugin>

        <!--
          Truezip plugin.
          https://www.mojohaus.org/truezip/truezip-maven-plugin/

          Used to pack and unpack zip files during the build.
        -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>truezip-maven-plugin</artifactId>
          <version>${io7m.truezip-maven-plugin.version}</version>
        </plugin>

        <!--
          Maven Shade plugin.
          https://maven.apache.org/plugins/maven-shade-plugin/

          Used to produce efficient onejars.
        -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>${io7m.maven-shade-plugin.version}</version>
        </plugin>

        <!--
          Build Helper plugin.
          https://www.mojohaus.org/build-helper-maven-plugin/

          Used to add source directories and other project-specific tasks.
        -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${io7m.build-helper-maven-plugin.version}</version>

          <!-- Parse the project version information and declare properties -->
          <executions>
            <execution>
              <id>insert-version</id>
              <phase>initialize</phase>
              <goals>
                <goal>parse-version</goal>
              </goals>
              <configuration>
                <propertyPrefix>${project.artifactId}</propertyPrefix>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!--
          Enforcer plugin.
          https://maven.apache.org/enforcer/maven-enforcer-plugin/

          The plugin is preloaded with rules to ensure that
          descendants of this project define the required properties.
        -->
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${io7m.maven-enforcer-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>extra-enforcer-rules</artifactId>
              <version>${io7m.extra-enforcer-rules.version}</version>
            </dependency>
            <dependency>
              <groupId>org.scijava</groupId>
              <artifactId>scijava-maven-plugin</artifactId>
              <version>${io7m.scijava-maven-plugin.version}</version>
            </dependency>
          </dependencies>

          <!-- Perform checks during build -->
          <executions>
            <execution>
              <id>enforce-rules</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <!--
                    Standard Rules
                    https://maven.apache.org/enforcer/enforcer-rules/
                  -->

                  <!-- Require Maven [3.8.2, 4.0.0) -->
                  <requireMavenVersion>
                    <version>[3.8.2, 4.0.0)</version>
                  </requireMavenVersion>

                  <!-- Require JDK version -->
                  <requireJavaVersion>
                    <version>${io7m.java.requiredSDKBuildVersion}</version>
                  </requireJavaVersion>

                  <!--
                    Extra Enforcer Rules
                    org.codehaus.mojo:extra-enforcer-rules
                    https://www.mojohaus.org/extra-enforcer-rules/
                  -->

                  <!--
                    Do not allow circular dependencies.
                    Mostly impossible anyway, but... just in case.
                  -->
                  <banCircularDependencies/>

                  <!--
                    Require that the previous version number be correctly defined.
                  -->
                  <requireProperty>
                    <property>io7m.api.previousVersion</property>
                    <regex>[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?</regex>
                  </requireProperty>

                  <!--
                    Require that the checkstyle artifact be correctly defined.
                  -->
                  <requireProperty>
                    <property>io7m.checkstyle.artifact</property>
                    <regex>[a-zA-Z0-9\-_\.]+</regex>
                  </requireProperty>

                  <!--
                    Require that the checkstyle path be correctly defined.
                  -->
                  <requireProperty>
                    <property>io7m.checkstyle.path</property>
                    <regex>[a-zA-Z0-9/\-\._]+</regex>
                  </requireProperty>

                  <!-- Require inheriting POMs to populate key elements. -->
                  <requireElements implementation="org.scijava.maven.plugin.enforcer.RequireElements">
                    <elements>
                      <element>description</element>
                      <element>name</element>
                      <element>url</element>
                    </elements>
                  </requireElements>

                  <!--
                    Require builds to be reproducible.
                    This means no snapshot dependencies!
                  -->
                  <requireReleaseDeps>
                    <message>No snapshot dependencies are allowed.</message>
                    <onlyWhenRelease>true</onlyWhenRelease>
                  </requireReleaseDeps>

                  <!--
                    Require that bytecode is at most ${io7m.java.targetJavaVersion}.
                  -->
                  <enforceBytecodeVersion>
                    <maxJdkVersion>${io7m.java.targetJavaVersion}</maxJdkVersion>
                  </enforceBytecodeVersion>
                </rules>
                <fail>true</fail>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!--
          Build Number Maven plugin
          https://www.mojohaus.org/buildnumber-maven-plugin/
          This plugin embeds a build number in the JAR manifest.
        -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>${io7m.buildnumber-maven-plugin.version}</version>

          <!-- Record SCM revision in manifest. -->
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>create</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
            <revisionOnScmFailure>UNKNOWN</revisionOnScmFailure>
          </configuration>
        </plugin>

        <!--
          Checkstyle plugin.
          https://maven.apache.org/plugins/maven-checkstyle-plugin/

          Each project must provide a module that contains checkstyle rules.
         -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${io7m.maven-checkstyle-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>${io7m.checkstyle.groupId}</groupId>
              <artifactId>${io7m.checkstyle.artifact}</artifactId>
              <version>${io7m.checkstyle.version}</version>
            </dependency>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${io7m.checkstyle.tools.version}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>validate</id>
              <phase>process-sources</phase>
              <configuration>
                <configLocation>${io7m.checkstyle.path}</configLocation>
                <encoding>UTF-8</encoding>
                <consoleOutput>true</consoleOutput>
                <failsOnError>true</failsOnError>
                <sourceDirectories>
                  <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                </sourceDirectories>
              </configuration>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <!--
          Checksum plugin
          https://checksum-maven-plugin.nicoulaj.net
        -->
        <plugin>
          <groupId>net.nicoulaj.maven.plugins</groupId>
          <artifactId>checksum-maven-plugin</artifactId>
          <version>${io7m.checksum-maven-plugin.version}</version>

          <!-- Show checksums during the build -->
          <executions>
            <execution>
              <id>checksum-artifacts</id>
              <goals>
                <goal>artifacts</goal>
              </goals>
              <phase>verify</phase>
              <configuration>
                <algorithms>
                  <algorithm>SHA-256</algorithm>
                </algorithms>
                <individualFiles>false</individualFiles>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!--
          Source plugin.
          https://maven.apache.org/plugins/maven-source-plugin/
        -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${io7m.maven-source-plugin.version}</version>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>jar-no-fork</goal>
                <goal>test-jar-no-fork</goal>
              </goals>
              <configuration>
                <archive>
                  <manifestEntries>
                    <Specification-Title>${project.name} (Sources)</Specification-Title>
                    <Specification-Version>${project.version}</Specification-Version>
                    <Specification-Vendor>${io7m.jar.vendor}</Specification-Vendor>
                    <Implementation-Title>${project.name} (Sources)</Implementation-Title>
                    <Implementation-Version>${project.version}</Implementation-Version>
                    <Implementation-Vendor>${io7m.jar.vendor}</Implementation-Vendor>
                    <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                    <Implementation-Build>${buildNumber}</Implementation-Build>
                    <Built-By>${io7m.jar.built_by}</Built-By>
                  </manifestEntries>
                </archive>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!--
          BND Maven plugin.
          https://github.com/bndtools/bnd/tree/master/maven/bnd-maven-plugin

          Used to produce manifests in OSGi bundles. Note that we use the $[...]
          syntax in order to defer evaluation of properties to bnd. This ensures
          that the properties get evaluated at the latest possible moment (in the
          context of child projects) as opposed to being evaluated eagerly within
          the context of the primogenitor (and, as a result, assigning the same
          values to all child projects).
        -->
        <plugin>
          <groupId>biz.aQute.bnd</groupId>
          <artifactId>bnd-maven-plugin</artifactId>
          <version>${io7m.bnd-maven-plugin.version}</version>
          <configuration>
            <bnd>
<![CDATA[
Automatic-Module-Name:    $[project.artifactId]
Built-By:                 $[io7m.jar.built_by]
Bundle-Description:       $[project.description]
Bundle-DocURL:            $[project.distributionManagement.site.url]
Bundle-Name:              $[project.artifactId] $[project.version] - $[project.description]
Bundle-SCM:               $[project.scm.url]
Bundle-Vendor:            $[io7m.jar.vendor]
Implementation-Build:     $[buildNumber]
Implementation-Title:     $[project.name]
Implementation-Vendor:    $[io7m.jar.vendor]
Implementation-Vendor-Id: $[project.groupId]
Implementation-Version:   $[project.version]
Sealed:                   true
Specification-Title:      $[project.name]
Specification-Vendor:     $[io7m.jar.vendor]
Specification-Version:    $[project.version]

-noextraheaders: true
-snapshot:       SNAPSHOT
-removeheaders:  Bnd-LastModified, Tool, Private-Package, Build-Jdk-Spec
]]></bnd>
          </configuration>
          <executions>
            <execution>
              <id>generate-osgi-manifest</id>
              <goals>
                <goal>bnd-process</goal>
              </goals>
              <phase>process-classes</phase>
            </execution>
          </executions>
        </plugin>

        <!--
          BND Baseline Maven plugin.
          https://github.com/bndtools/bnd/tree/master/maven/bnd-baseline-maven-plugin

          Used to check that code obeys semantic versioning rules.
        -->
        <plugin>
          <groupId>biz.aQute.bnd</groupId>
          <artifactId>bnd-baseline-maven-plugin</artifactId>
          <version>${io7m.bnd-baseline-maven-plugin.version}</version>
          <executions>
            <execution>
              <id>analyze-semantic-versioning</id>
              <goals>
                <goal>baseline</goal>
              </goals>
              <phase>verify</phase>
              <configuration>
                <base>
                  <groupId>${io7m.api.previousGroupId}</groupId>
                  <artifactId>${io7m.api.previousArtifactId}</artifactId>
                  <version>${io7m.api.previousVersion}</version>
                </base>
                <includeDistributionManagement>false</includeDistributionManagement>
                <failOnMissing>false</failOnMissing>
                <fullReport>true</fullReport>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!--
          BND Indexer Maven plugin.
          https://github.com/bndtools/bnd/tree/master/maven/bnd-indexer-maven-plugin

          Used to create OSGi indices of bundles.
        -->
        <plugin>
          <groupId>biz.aQute.bnd</groupId>
          <artifactId>bnd-indexer-maven-plugin</artifactId>
          <version>${io7m.bnd-indexer-maven-plugin.version}</version>
        </plugin>

        <!--
          BND Resolver Maven plugin.
          https://github.com/bndtools/bnd/tree/master/maven/bnd-resolver-maven-plugin

          Used to resolve bundles from bndrun files.
        -->
        <plugin>
          <groupId>biz.aQute.bnd</groupId>
          <artifactId>bnd-resolver-maven-plugin</artifactId>
          <version>${io7m.bnd-resolver-maven-plugin.version}</version>
        </plugin>

        <!--
          BND Resolver Maven plugin.
          https://github.com/bndtools/bnd/tree/master/maven/bnd-export-maven-plugin

          Used to export bndrun files.
        -->
        <plugin>
          <groupId>biz.aQute.bnd</groupId>
          <artifactId>bnd-export-maven-plugin</artifactId>
          <version>${io7m.bnd-export-maven-plugin.version}</version>
        </plugin>

        <!--
          SpotBugs Maven Plugin
          https://spotbugs.github.io/spotbugs-maven-plugin/

          Used to locate probable bugs in code.
        -->
        <plugin>
          <groupId>com.github.spotbugs</groupId>
          <artifactId>spotbugs-maven-plugin</artifactId>
          <version>${io7m.spotbugs-maven-plugin.version}</version>
          <configuration>
            <!-- https://github.com/spotbugs/spotbugs-maven-plugin/issues/423 -->
            <fork>true</fork>
            <effort>Max</effort>
            <threshold>Low</threshold>
            <xmlOutput>true</xmlOutput>
            <plugins>

              <!--
                Security-related rules.

                https://find-sec-bugs.github.io/bugs.htm
              -->

              <dependency>
                <groupId>com.h3xstream.findsecbugs</groupId>
                <artifactId>findsecbugs-plugin</artifactId>
                <version>${io7m.findsecbugs-plugin.version}</version>
              </dependency>

              <!--
                Extra contributed rules.

                https://fb-contrib.sourceforge.net/bugdescriptions.html
              -->

              <dependency>
                <groupId>com.mebigfatguy.fb-contrib</groupId>
                <artifactId>fb-contrib</artifactId>
                <version>${io7m.fb-contrib-plugin.version}</version>
              </dependency>
            </plugins>
          </configuration>
          <executions>
            <execution>
              <id>analyze-bugs</id>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>process-classes</phase>
            </execution>
          </executions>
        </plugin>

        <!--
          JavaDoc plugin.
          https://maven.apache.org/plugins/maven-javadoc-plugin/
        -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${io7m.maven-javadoc-plugin.version}</version>
        </plugin>

        <!--
          Jar plugin.
          https://maven.apache.org/plugins/maven-jar-plugin/
        -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${io7m.maven-jar-plugin.version}</version>
          <executions>

            <!-- Produce jar file with custom manifest -->
            <execution>
              <id>default-jar</id>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <archive>
                  <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                </archive>
              </configuration>
            </execution>

            <!-- Produce jar file of tests -->
            <execution>
              <id>test-jar</id>
              <phase>package</phase>
              <goals>
                <goal>test-jar</goal>
              </goals>
              <configuration>
                <!-- https://issues.apache.org/jira/browse/MCOMPILER-296 -->
                <excludes>
                  <exclude>META-INF/jpms.args</exclude>
                </excludes>

                <archive>
                  <addMavenDescriptor>false</addMavenDescriptor>
                  <manifest>
                    <addDefaultEntries>false</addDefaultEntries>
                  </manifest>
                  <manifestEntries>
                    <Specification-Title>${project.name} (Tests)</Specification-Title>
                    <Specification-Version>${project.version}</Specification-Version>
                    <Specification-Vendor>${io7m.jar.vendor}</Specification-Vendor>
                    <Implementation-Title>${project.name} (Tests)</Implementation-Title>
                    <Implementation-Version>${project.version}</Implementation-Version>
                    <Implementation-Vendor>${io7m.jar.vendor}</Implementation-Vendor>
                    <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                    <Implementation-Build>${buildNumber}</Implementation-Build>
                    <Built-By>${io7m.jar.built_by}</Built-By>
                  </manifestEntries>
                </archive>
              </configuration>
            </execution>

            <!-- Produce an empty JavaDoc jar. -->
            <execution>
              <id>empty-javadoc-jar</id>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <classifier>javadoc</classifier>
                <excludes>
                  <exclude>**/**</exclude>
                </excludes>
                <archive>
                  <addMavenDescriptor>false</addMavenDescriptor>
                  <manifest>
                    <addDefaultEntries>false</addDefaultEntries>
                  </manifest>
                  <manifestEntries>
                    <Built-By>${io7m.jar.built_by}</Built-By>
                  </manifestEntries>
                </archive>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!--
          Reproducible Build plugin
          https://zlika.github.io/reproducible-build-maven-plugin/index.html
        -->
        <plugin>
          <groupId>io.github.zlika</groupId>
          <artifactId>reproducible-build-maven-plugin</artifactId>
          <version>${io7m.reproducible-build-maven-plugin.version}</version>

          <!-- Attempt to strip artifacts for reproducibility -->
          <executions>
            <execution>
              <id>reproducible-jar</id>
              <phase>package</phase>
              <goals>
                <goal>strip-jar</goal>
              </goals>
              <configuration>
                <overwrite>true</overwrite>
                <includes>
                  <include>${project.artifactId}-${project.version}.*\.jar</include>
                </includes>
                <manifestAttributes>
                  <manifestAttribute>Build-Jdk-Spec</manifestAttribute>
                </manifestAttributes>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!--
          Nexus staging plugin.
          https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin

          This allows for deployment to Maven Central via the command line.
        -->
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${io7m.nexus-staging-maven-plugin.version}</version>
          <extensions>true</extensions>
          <configuration>
            <serverId>sonatype-nexus-staging</serverId>
            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
            <description>${project.groupId}:${project.artifactId}:${project.version}</description>
            <autoReleaseAfterClose>true</autoReleaseAfterClose>
          </configuration>
        </plugin>

        <!--
          Maven Dependency plugin.
          https://maven.apache.org/plugins/maven-dependency-plugin/index.html

          This allows for the analysis of dependencies to avoid conflicts,
          display "used but undeclared" dependencies, unused dependencies,
          and so on.
        -->

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

          <!-- Analyze dependencies -->
          <executions>
            <execution>
              <id>analyze</id>
              <goals>
                <goal>analyze-only</goal>
              </goals>
              <phase>process-classes</phase>
              <configuration>
                <failOnWarning>true</failOnWarning>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!--
          Maven JaCoCo plugin.
          https://www.jacoco.org/

          This collects code coverage data for publication.
        -->
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${io7m.jacoco-maven-plugin.version}</version>
          <executions>
            <execution>
              <id>jacoco-agent</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
            <execution>
              <id>jacoco-agent-integration</id>
              <goals>
                <goal>prepare-agent-integration</goal>
              </goals>
            </execution>
            <execution>
              <id>jacoco-report</id>
              <phase>test</phase>
              <goals>
                <goal>report</goal>
              </goals>
            </execution>
            <execution>
              <id>jacoco-report-aggregate</id>
              <phase>test</phase>
              <goals>
                <goal>report-aggregate</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <!--
          Exec Maven plugin.
          https://www.mojohaus.org/exec-maven-plugin/

          Used for general Java/Executable calls.
        -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>${io7m.exec-maven-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>

      <!--
        The series of plugins executed for all builds.
      -->

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>biz.aQute.bnd</groupId>
        <artifactId>bnd-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>io.github.zlika</groupId>
        <artifactId>reproducible-build-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>biz.aQute.bnd</groupId>
        <artifactId>bnd-baseline-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>net.nicoulaj.maven.plugins</groupId>
        <artifactId>checksum-maven-plugin</artifactId>
        <inherited>true</inherited>
      </plugin>

      <!-- Disable the site plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <executions>
          <execution>
            <id>default-site</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- Sign artifacts when deploying to io7m -->
    <profile>
      <id>io7m-deployment-private</id>
      <activation>
        <property>
          <name>io7m.deployment</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${io7m.maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Enable the staging plugin for releases -->
    <profile>
      <id>io7m-release</id>
      <activation>
        <property>
          <name>io7m.release</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <extensions>true</extensions>
            <executions>
              <execution>
                <id>deploy-packages</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Enable the quickest possible build -->
    <profile>
      <id>io7m-quick-build</id>
      <activation>
        <property>
          <name>io7m.quickBuild</name>
        </property>
      </activation>
      <properties>
        <assembly.skipAssembly>true</assembly.skipAssembly>
        <bnd.baseline.skip>true</bnd.baseline.skip>
        <checkstyle.skip>true</checkstyle.skip>
        <enforcer.skip>true</enforcer.skip>
        <jacoco.skip>true</jacoco.skip>
        <kstructural.skip>true</kstructural.skip>
        <maven.buildNumber.skip>true</maven.buildNumber.skip>
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <maven.source.skip>true</maven.source.skip>
        <mdep.analyze.skip>true</mdep.analyze.skip>
        <skipTests>true</skipTests>
        <spotbugs.skip>true</spotbugs.skip>
      </properties>
    </profile>

    <!-- Allow deploying to an alternate repository -->
    <profile>
      <id>io7m-alternate-repository</id>
      <activation>
        <property>
          <name>io7m.useAlternateRepository</name>
        </property>
      </activation>
      <distributionManagement>
        <repository>
          <id>${io7m.repository.releases.id}</id>
          <url>${io7m.repository.releases.url}</url>
        </repository>
        <snapshotRepository>
          <id>${io7m.repository.snapshots.id}</id>
          <url>${io7m.repository.snapshots.url}</url>
        </snapshotRepository>
      </distributionManagement>
    </profile>
  </profiles>

</project>
