<?xml version="1.0"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.inrupt.rdf</groupId>
  <artifactId>inrupt-commons-rdf4j</artifactId>
  <version>0.6.0</version>
  <name>Commons RDF Adaptor for RDF4J</name>
  <url>https://inrupt.com</url>
  <description>
      An RDF4J adaptor for the Apache Commons RDF APIs.
  </description>

  <properties>
    <maven.compiler.parameters>true</maven.compiler.parameters>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- dependencies -->
    <commons.rdf.version>0.5.0</commons.rdf.version>
    <rdf4j.version>4.2.3</rdf4j.version>

    <!-- plugins -->
    <buildhelper.plugin.version>3.3.0</buildhelper.plugin.version>
    <checkstyle.plugin.version>3.2.1</checkstyle.plugin.version>
    <clean.plugin.version>3.2.0</clean.plugin.version>
    <compiler.plugin.version>3.11.0</compiler.plugin.version>
    <deploy.plugin.version>3.1.1</deploy.plugin.version>
    <install.plugin.version>3.1.1</install.plugin.version>
    <git.plugin.version>4.9.10</git.plugin.version>
    <gpg.plugin.version>3.0.1</gpg.plugin.version>
    <jacoco.plugin.version>0.8.8</jacoco.plugin.version>
    <jar.plugin.version>3.3.0</jar.plugin.version>
    <javadoc.plugin.version>3.5.0</javadoc.plugin.version>
    <license.plugin.version>4.1</license.plugin.version>
    <nexus.plugin.version>1.6.13</nexus.plugin.version>
    <owasp.plugin.version>8.2.1</owasp.plugin.version>
    <projectinfo.plugin.version>3.4.1</projectinfo.plugin.version>
    <pmd.plugin.version>3.20.0</pmd.plugin.version>
    <release.plugin.version>3.0.0</release.plugin.version>
    <resources.plugin.version>3.3.1</resources.plugin.version>
    <site.plugin.version>3.12.1</site.plugin.version>
    <sonar.plugin.version>3.9.1.2184</sonar.plugin.version>
    <source.plugin.version>3.2.1</source.plugin.version>
    <surefire.plugin.version>3.0.0</surefire.plugin.version>

    <!-- tooling -->
    <checkstyle.tool.version>10.9.3</checkstyle.tool.version>

    <!-- testing -->
    <junit.version>5.9.2</junit.version>
    <slf4j.version>2.0.7</slf4j.version>

    <!-- sonar -->
    <sonar.coverage.jacoco.xmlReportPaths>${maven.multiModuleProjectDirectory}/target/site/jacoco-merged/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
    <sonar.host.url>https://sonarqube.dev.inrupt.com</sonar.host.url>
    <sonar.projectKey>commons-rdf4j</sonar.projectKey>
    <sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
  </properties>

  <distributionManagement>
    <snapshotRepository>
      <name>Snapshot Repository</name>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <name>Staging Repository</name>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
    </repository>
  </distributionManagement>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.eclipse.rdf4j</groupId>
        <artifactId>rdf4j-bom</artifactId>
        <version>${rdf4j.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-rdf-api</artifactId>
        <version>${commons.rdf.version}</version>
      </dependency>

      <!-- testing -->
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-rdf-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-model</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-repository-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-rio-turtle</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-rio-ntriples</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-rio-nquads</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-rio-rdfxml</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-rio-trig</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-rio-jsonld</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-sail-memory</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-repository-sail</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${clean.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${deploy.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>${install.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${jar.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${javadoc.plugin.version}</version>
          <configuration>
            <sourceFileExcludes>**/generated-sources/**</sourceFileExcludes>
            <quiet>true</quiet>
            <links>
              <link>https://rdf4j.org/javadoc/latest/</link>
            </links>
            <tags>
              <tag>
                <name>implSpec</name>
                <placement>a</placement>
                <head>Implementation Requirements:</head>
              </tag>
              <tag>
                <name>implNote</name>
                <placement>a</placement>
                <head>Implementation Note:</head>
              </tag>
              <tag>
                <name>apiNote</name>
                <placement>a</placement>
                <head>API Note:</head>
              </tag>
            </tags>
          </configuration>
          <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>${gpg.plugin.version}</version>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <phase>verify</phase>
              <goals>
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>${source.plugin.version}</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${compiler.plugin.version}</version>
          <configuration>
            <compilerArgs>
              <arg>-Xlint:deprecation</arg>
              <arg>-Xlint:unchecked</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${surefire.plugin.version}</version>
          <configuration>
            <argLine>${surefire.jacoco.args}</argLine>
            <systemPropertyVariables>
              <maven.home>${maven.home}</maven.home>
            </systemPropertyVariables>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <!-- keep the surefire and failsafe plugin versions aligned -->
          <version>${surefire.plugin.version}</version>
          <executions>
            <execution>
              <id>integration-test</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <argLine>${failsafe.jacoco.args}</argLine>
            <systemPropertyVariables>
              <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
              <maven.home>${maven.home}</maven.home>
            </systemPropertyVariables>
          </configuration>
        </plugin>
        <plugin>
          <groupId>pl.project13.maven</groupId>
          <artifactId>git-commit-id-plugin</artifactId>
          <version>${git.plugin.version}</version>
          <executions>
            <execution>
              <id>get-the-git-infos</id>
              <goals>
                <goal>revision</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <generateGitPropertiesFile>false</generateGitPropertiesFile>
            <failOnNoGitDirectory>false</failOnNoGitDirectory>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${release.plugin.version}</version>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <goals>install</goals>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${checkstyle.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco.plugin.version}</version>
          <executions>
            <execution>
              <id>before-unit-test-execution</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
              <configuration>
                <propertyName>surefire.jacoco.args</propertyName>
              </configuration>
            </execution>
            <execution>
              <id>before-integration-test-execution</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>prepare-agent-integration</goal>
              </goals>
              <configuration>
                <propertyName>failsafe.jacoco.args</propertyName>
              </configuration>
            </execution>
            <execution>
              <id>merge-unit-and-integration</id>
              <phase>post-integration-test</phase>
              <goals>
                <goal>merge</goal>
              </goals>
              <configuration>
                <fileSets>
                  <fileSet>
                    <directory>${project.build.directory}</directory>
                    <includes>
                      <include>*.exec</include>
                    </includes>
                  </fileSet>
                </fileSets>
                <destFile>${project.build.directory}/jacoco-merged.exec</destFile>
              </configuration>
            </execution>
            <execution>
              <id>create-merged-report</id>
              <phase>post-integration-test</phase>
              <goals>
                <goal>report</goal>
              </goals>
              <configuration>
                <dataFile>${project.build.directory}/jacoco-merged.exec</dataFile>
                <outputDirectory>${project.reporting.outputDirectory}/merged-test-report</outputDirectory>
              </configuration>
            </execution>
            <execution>
              <id>report-aggregate-unit</id>
              <phase>verify</phase>
              <goals>
                <goal>report-aggregate</goal>
              </goals>
              <configuration>
                <dataFileIncludes>*/jacoco.exec</dataFileIncludes>
                <outputDirectory>${project.reporting.outputDirectory}/jacoco-unit</outputDirectory>
              </configuration>
            </execution>
            <execution>
              <id>report-aggregate-integration</id>
              <phase>verify</phase>
              <goals>
                <goal>report-aggregate</goal>
              </goals>
              <configuration>
                <dataFileIncludes>*/jacoco-it.exec</dataFileIncludes>
                <outputDirectory>${project.reporting.outputDirectory}/jacoco-integration</outputDirectory>
              </configuration>
            </execution>
            <execution>
              <id>report-aggregate</id>
              <phase>verify</phase>
              <goals>
                <goal>report-aggregate</goal>
              </goals>
              <configuration>
                <dataFileIncludes>*/jacoco-merged.exec</dataFileIncludes>
                <outputDirectory>${project.reporting.outputDirectory}/jacoco-merged</outputDirectory>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${buildhelper.plugin.version}</version>
          <executions>
            <execution>
              <id>parse-version</id>
              <goals>
                <goal>parse-version</goal>
              </goals>
            </execution>
            <execution>
              <id>regex-properties</id>
              <goals>
                <goal>regex-properties</goal>
              </goals>
              <phase>generate-sources</phase>
              <configuration>
                <regexPropertySettings>
                  <regexPropertySetting>
                    <name>application.version</name>
                    <value>${project.version}</value>
                    <regex>-SNAPSHOT</regex>
                    <replacement>-dev-\$\{git.commit.id.abbrev\}</replacement>
                    <failIfNoMatch>false</failIfNoMatch>
                  </regexPropertySetting>
                  <regexPropertySetting>
                    <name>inrupt.image-tag</name>
                    <value>${project.version}</value>
                    <regex>.+-SNAPSHOT</regex>
                    <replacement>\$\{git.commit.id\}</replacement>
                    <failIfNoMatch>false</failIfNoMatch>
                  </regexPropertySetting>
                </regexPropertySettings>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>${pmd.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${resources.plugin.version}</version>
          <configuration>
            <propertiesEncoding>UTF-8</propertiesEncoding>
            <encoding>UTF-8</encoding>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>${site.plugin.version}</version>
          <configuration>
            <outputDirectory>${project.build.directory}/site</outputDirectory>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>${sonar.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${nexus.plugin.version}</version>
          <extensions>true</extensions>
          <configuration>
            <serverId>ossrh</serverId>
            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
            <autoReleaseAfterClose>true</autoReleaseAfterClose>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.owasp</groupId>
          <artifactId>dependency-check-maven</artifactId>
          <version>${owasp.plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>


    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <dependencies>
          <!-- Override dependencies to use latest version of checkstyle -->
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${checkstyle.tool.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <consoleOutput>true</consoleOutput>
          <logViolationsToConsole>true</logViolationsToConsole>
          <failsOnError>true</failsOnError>
          <failOnViolation>true</failOnViolation>
          <violationSeverity>warning</violationSeverity>
          <configLocation>./build-tools/checkstyle/checkstyle.xml</configLocation>
          <suppressionsLocation>./build-tools/checkstyle/suppressions.xml</suppressionsLocation>
          <sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
        </configuration>
        <executions>
          <execution>
            <id>checkstyle</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <configuration>
          <linkXRef>false</linkXRef>
          <failOnViolation>false</failOnViolation>
          <verbose>true</verbose>
          <rulesets>
            <ruleset>./build-tools/pmd/pmd.xml</ruleset>
          </rulesets>
          <excludeRoots>
            <excludeRoot>target/generated-sources</excludeRoot>
          </excludeRoots>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.owasp</groupId>
        <artifactId>dependency-check-maven</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <failBuildOnCVSS>7</failBuildOnCVSS>
          <formats>
            <format>HTML</format>
            <format>JSON</format>
            <format>CSV</format>
          </formats>
          <suppressionFile>
              ./build-tools/owasp/suppressions.xml
          </suppressionFile>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${javadoc.plugin.version}</version>
        <reportSets>
          <reportSet>
            <id>default</id>
            <reports>
              <report>javadoc</report>
            </reports>
          </reportSet>
          <reportSet>
            <id>aggregate</id>
            <inherited>false</inherited>
            <reports>
              <report>aggregate</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.owasp</groupId>
        <artifactId>dependency-check-maven</artifactId>
        <version>${owasp.plugin.version}</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>aggregate</report>
            </reports>
          </reportSet>
        </reportSets>
        <configuration>
          <suppressionFiles>
            <suppressionFile>./build-tools/owasp/suppressions.xml</suppressionFile>
          </suppressionFiles>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>publish</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <developers>
    <developer>
      <id>acoburn</id>
      <name>Aaron Coburn</name>
      <email>aaronc@inrupt.com</email>
      <organization>Inrupt</organization>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/inrupt/commons-rdf-rdf4j.git</connection>
    <developerConnection>scm:git:git@github.com:inrupt/commons-rdf-rdf4j.git</developerConnection>
    <url>https://github.com/inrupt/commons-rdf-rdf4j</url>
    <tag>inrupt-commons-rdf4j-0.6.0</tag>
  </scm>

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

  <organization>
    <name>Inrupt, Inc</name>
    <url>https://inrupt.com</url>
  </organization>

</project>
