<?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.io7m.primogenitor</groupId>
  <artifactId>com.io7m.primogenitor</artifactId>
  <version>2.0.0</version>
  <packaging>pom</packaging>

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

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

    <!-- The groupId of the artifact that contains checkstyle rules for the project. -->
    <io7m.checkstyle.groupId>${project.groupId}</io7m.checkstyle.groupId>

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

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

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

    <!-- The version of the checkstyle tools used -->
    <io7m.checkstyle.tools.version>8.5</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 Maven Dependency plugin does not yet support JDK 9 -->
    <mdep.analyze.skip>true</mdep.analyze.skip>

    <!-- The versions of all plugins used -->
    <io7m.build-helper-maven-plugin.version>3.0.0</io7m.build-helper-maven-plugin.version>
    <io7m.buildnumber-maven-plugin.version>1.4</io7m.buildnumber-maven-plugin.version>
    <io7m.com.io7m.minisite.maven_plugin.version>0.0.9</io7m.com.io7m.minisite.maven_plugin.version>
    <io7m.jacoco-maven-plugin.version>0.7.9</io7m.jacoco-maven-plugin.version>
    <io7m.maven-assembly-plugin.version>3.1.0</io7m.maven-assembly-plugin.version>
    <io7m.maven-bundle-plugin.version>3.3.0</io7m.maven-bundle-plugin.version>
    <io7m.maven-checkstyle-plugin.version>2.17</io7m.maven-checkstyle-plugin.version>
    <io7m.maven-clean-plugin.version>3.0.0</io7m.maven-clean-plugin.version>
    <io7m.maven-compiler-plugin.version>3.7.0</io7m.maven-compiler-plugin.version>
    <io7m.maven-dependency-plugin.version>3.0.2</io7m.maven-dependency-plugin.version>
    <io7m.maven-deploy-plugin.version>2.8.2</io7m.maven-deploy-plugin.version>
    <io7m.maven-enforcer-plugin.version>3.0.0-M1</io7m.maven-enforcer-plugin.version>
    <io7m.maven-install-plugin.version>2.5.2</io7m.maven-install-plugin.version>
    <io7m.maven-jar-plugin.version>3.0.2</io7m.maven-jar-plugin.version>
    <io7m.maven-javadoc-plugin.version>3.0.0</io7m.maven-javadoc-plugin.version>
    <io7m.maven-resources-plugin.version>3.0.2</io7m.maven-resources-plugin.version>
    <io7m.maven-shade-plugin.version>3.1.0</io7m.maven-shade-plugin.version>
    <io7m.maven-site-plugin.version>3.6</io7m.maven-site-plugin.version>
    <io7m.maven-source-plugin.version>3.0.1</io7m.maven-source-plugin.version>
    <io7m.maven-surefire-plugin.version>2.20.1</io7m.maven-surefire-plugin.version>
    <io7m.nexus-staging-maven-plugin.version>1.6.8</io7m.nexus-staging-maven-plugin.version>
    <io7m.reproducible-build-maven-plugin.version>0.4</io7m.reproducible-build-maven-plugin.version>
    <io7m.truezip-maven-plugin.version>1.2</io7m.truezip-maven-plugin.version>
  </properties>

  <inceptionYear>2017</inceptionYear>

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

  <scm>
    <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>http://io7m.com</url>
    </developer>
  </developers>

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

  <distributionManagement>
    <site>
      <id>GitHub</id>
      <name>GitHub</name>
      <url>https://github.com/io7m/primogenitor</url>
    </site>
    <repository>
      <id>sonatype-nexus-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <ciManagement>
    <system>Travis CI</system>
    <url>https://travis-ci.org/io7m/primogenitor</url>
  </ciManagement>

  <prerequisites>
    <maven>3.5.0</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>
        </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>

        <!--
          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.
          http://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.
          http://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>
        </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>1.0-beta-6</version>
            </dependency>
            <dependency>
              <groupId>org.scijava</groupId>
              <artifactId>scijava-maven-plugin</artifactId>
              <version>1.0.0</version>
            </dependency>
          </dependencies>
        </plugin>

        <!--
          Build Number Maven plugin
          http://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>
                <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
              </configuration>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <!--
          Reproducible Build plugin
          http://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>
        </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}</Specification-Title>
                    <Specification-Version>${project.version}</Specification-Version>
                    <Specification-Vendor>io7m.com</Specification-Vendor>
                    <Implementation-Title>${project.name}</Implementation-Title>
                    <Implementation-Version>${project.version}</Implementation-Version>
                    <Implementation-Vendor>io7m.com</Implementation-Vendor>
                    <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                    <Implementation-Build>${buildNumber}</Implementation-Build>
                    <Built-By>io7m</Built-By>
                  </manifestEntries>
                </archive>
              </configuration>
            </execution>
          </executions>
        </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>
              <configuration>
                <archive>
                  <manifestEntries>
                    <Specification-Title>${project.name}</Specification-Title>
                    <Specification-Version>${project.version}</Specification-Version>
                    <Specification-Vendor>io7m.com</Specification-Vendor>
                    <Implementation-Title>${project.name}</Implementation-Title>
                    <Implementation-Version>${project.version}</Implementation-Version>
                    <Implementation-Vendor>io7m.com</Implementation-Vendor>
                    <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                    <Implementation-Build>${buildNumber}</Implementation-Build>
                    <Built-By>io7m</Built-By>
                    <Sealed>true</Sealed>
                  </manifestEntries>
                </archive>
              </configuration>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>

            <!-- Produce jar file of tests -->
            <execution>
              <id>test-jar</id>
              <goals>
                <goal>test-jar</goal>
              </goals>
              <configuration>
                <archive>
                  <manifestEntries>
                    <Specification-Title>${project.name}</Specification-Title>
                    <Specification-Version>${project.version}</Specification-Version>
                    <Specification-Vendor>io7m.com</Specification-Vendor>
                    <Implementation-Title>${project.name}</Implementation-Title>
                    <Implementation-Version>${project.version}</Implementation-Version>
                    <Implementation-Vendor>io7m.com</Implementation-Vendor>
                    <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                    <Implementation-Build>${buildNumber}</Implementation-Build>
                    <Built-By>io7m</Built-By>
                  </manifestEntries>
                </archive>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!--
          Bundle plugin.
          https://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html

          Used to produce OSGi bundles.
        -->
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>${io7m.maven-bundle-plugin.version}</version>
          <extensions>true</extensions>
          <configuration>
            <instructions>
              <Specification-Title>${project.name}</Specification-Title>
              <Specification-Version>${project.version}</Specification-Version>
              <Specification-Vendor>io7m.com</Specification-Vendor>
              <Implementation-Title>${project.name}</Implementation-Title>
              <Implementation-Version>${project.version}</Implementation-Version>
              <Implementation-Vendor>io7m.com</Implementation-Vendor>
              <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
              <Implementation-Build>${buildNumber}</Implementation-Build>
              <Bundle-DocURL>${project.url}</Bundle-DocURL>
              <Built-By>io7m</Built-By>
              <Sealed>true</Sealed>
              <_removeheaders>Bnd-LastModified, Tool, Private-Package</_removeheaders>
            </instructions>
          </configuration>
          <!-- Use a newer version of bndlib that supports Java 9    -->
          <!-- See: https://issues.apache.org/jira/browse/FELIX-5698 -->
          <dependencies>
            <dependency>
              <groupId>biz.aQute.bnd</groupId>
              <artifactId>biz.aQute.bndlib</artifactId>
              <version>3.5.0</version>
            </dependency>
          </dependencies>
        </plugin>

        <!--
          Maven 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>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <bottom><![CDATA[Copyright &#169; {currentYear} &lt;code@io7m.com&gt; http://io7m.com]]></bottom>
                <archive>
                  <manifestEntries>
                    <Specification-Title>${project.name}</Specification-Title>
                    <Specification-Version>${project.version}</Specification-Version>
                    <Specification-Vendor>io7m.com</Specification-Vendor>
                    <Implementation-Title>${project.name}</Implementation-Title>
                    <Implementation-Version>${project.version}</Implementation-Version>
                    <Implementation-Vendor>io7m.com</Implementation-Vendor>
                    <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                    <Implementation-Build>${buildNumber}</Implementation-Build>
                    <Built-By>io7m</Built-By>
                  </manifestEntries>
                </archive>
                <additionalparam>${io7m.javadoc.docLint}</additionalparam>
              </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://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>
        </plugin>

        <!--
          Maven JaCoCo plugin.
          http://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-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>

        <!--
          Maven minisite plugin.
          https://github.com/io7m/minisite

          Replaces the site plugin with something minimal.
        -->
        <plugin>
          <groupId>com.io7m.minisite</groupId>
          <artifactId>com.io7m.minisite.maven_plugin</artifactId>
          <version>${io7m.com.io7m.minisite.maven_plugin.version}</version>
          <executions>
            <execution>
              <id>minisite</id>
              <phase>site</phase>
              <goals>
                <goal>generateSite</goal>
              </goals>
              <configuration>
                <documentationFile>src/site/resources/documentation.xml</documentationFile>
                <overviewFile>src/site/resources/overview.xml</overviewFile>
                <featuresFile>src/site/resources/features.xml</featuresFile>
                <changelogFile>README-CHANGES.xml</changelogFile>
                <changelogFeedEmail>contact@io7m.com</changelogFeedEmail>
                <outputDirectory>${project.build.directory}/minisite</outputDirectory>
                <resourceDirectory>${project.basedir}/src/site/resources</resourceDirectory>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>

      <!-- Parse the project version -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>insert-version</id>
            <phase>initialize</phase>
            <goals>
              <goal>parse-version</goal>
            </goals>
            <configuration>
              <propertyPrefix>${project.artifactId}</propertyPrefix>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Check desired rules during maven lifecycle. -->
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-rules</id>
            <phase>validate</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <!--
                  Standard Rules
                  http://maven.apache.org/enforcer/enforcer-rules/
                -->
                <requirePluginVersions>
                  <message>Plugins need to be versioned!</message>
                </requirePluginVersions>

                <!-- Require Maven 3.5.0+ -->
                <requireMavenVersion>
                  <version>[3.5.0,)</version>
                </requireMavenVersion>

                <!-- Require JDK 9+ -->
                <requireJavaVersion>
                  <version>[9,)</version>
                </requireJavaVersion>

                <!--
                  Extra Enforcer Rules
                  org.codehaus.mojo:extra-enforcer-rules
                  http://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!
                -->
                <requireReproducibleBuilds implementation="org.scijava.maven.plugin.enforcer.RequireReproducibleBuilds"/>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Insert the build number into jar files -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
      </plugin>

      <!-- Produce a source jar -->
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>

      <!-- Produce a javadoc jar -->
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>

      <!-- Run tests -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>

      <!-- Produce an OSGi bundle -->
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
      </plugin>

      <!-- Process jar files for reproducible builds -->
      <plugin>
        <groupId>io.github.zlika</groupId>
        <artifactId>reproducible-build-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>reproducible-jar</id>
            <phase>package</phase>
            <goals>
              <goal>strip-jar</goal>
            </goals>
            <configuration>
              <overwrite>true</overwrite>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Analyze dependencies -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>analyze</id>
            <goals>
              <goal>analyze-only</goal>
            </goals>
            <phase>
              verify
            </phase>
            <configuration>
              <failOnWarning>true</failOnWarning>
            </configuration>
          </execution>
        </executions>
      </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>1.6</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>
  </profiles>

</project>
