<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>name.dmaus.schxslt</groupId>
  <artifactId>java</artifactId>
  <version>4.0</version>

  <name>SchXslt Java</name>
  <description>Java classes for Schematron validation with SchXslt</description>
  <url>https://github.com/schxslt/schxslt-java</url>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://opensource.org/licenses/MIT</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>dmaus</id>
      <name>David Maus</name>
      <email>dmaus@dmaus.name</email>
    </developer>
  </developers>

  <contributors>
    <contributor>
      <name>Eduard Drenth</name>
    </contributor>
  </contributors>

  <scm>
    <url>https://github.com/schxslt/schxslt-java</url>
    <connection>scm:git:https://github.com/schxslt/schxslt-java.git</connection>
  </scm>

  <issueManagement>
    <url>https://github.com/schxslt/schxslt-java/issues</url>
    <system>GitHub Issues</system>
  </issueManagement>

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

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>17</maven.compiler.release>
    <checkstyle.config.location>config/checkstyle.xml</checkstyle.config.location>
    <checkstyle.version>10.15.0</checkstyle.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.xmlresolver</groupId>
      <artifactId>xmlresolver</artifactId>
      <version>6.0.4</version>
    </dependency>
    <dependency>
      <groupId>name.dmaus.schxslt</groupId>
      <artifactId>schxslt</artifactId>
      <version>[1.9.5,]</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>name.dmaus.schxslt</groupId>
      <artifactId>schxslt2</artifactId>
      <version>[1.1,]</version>
      <scope>provided</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/net.jcip/jcip-annotations -->
    <dependency>
      <groupId>net.jcip</groupId>
      <artifactId>jcip-annotations</artifactId>
      <version>1.0</version>
    </dependency>
    <!-- Unit tests -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>5.11.0-M2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.11.0-M2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.sf.saxon</groupId>
      <artifactId>Saxon-HE</artifactId>
      <version>12.4</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>2.0.13</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <testOutputDirectory>${project.basedir}/target/test-classes/resources</testOutputDirectory>
    <testResources>
      <testResource>
        <directory>${project.basedir}/src/main/resources</directory>
      </testResource>
      <testResource>
        <directory>${project.basedir}/src/test/resources</directory>
      </testResource>
    </testResources>
    <plugins>
      <!-- Code quality -->
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>4.8.5.0</version>
        <configuration>
          <effort>Max</effort>
          <threshold>Low</threshold>
          <excludeFilterFile>config/spotbugs.xml</excludeFilterFile>
        </configuration>
        <executions>
          <execution>
            <id>check</id>
            <phase>test</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.4.0</version>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${checkstyle.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
          <tagNameFormat>v@{project.version}</tagNameFormat>
        </configuration>
      </plugin>
      <!-- Required to JUnit 5 working -->
      <!-- Cf. https://dzone.com/articles/why-your-junit-5-tests-are-not-running-under-maven -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.2.5</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>3.2.5</version>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.2</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.3.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.6.3</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.13</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
