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

  <artifactId>schxslt</artifactId>

  <name>SchXslt Core</name>
  <description>An XSLT-based Schematron processor</description>
  <url>https://doi.org/10.5281/zenodo.1495494</url>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>prepare-zip</id>
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/xslt-only</outputDirectory>
              <resources>
                <resource>
                  <directory>src/main/resources/xslt</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>prepare-xproc</id>
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/xproc</outputDirectory>
              <resources>
                <resource>
                  <directory>src/main/resources</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>io.xspec.maven</groupId>
        <artifactId>xspec-maven-plugin</artifactId>
        <version>2.0.0</version>
        <dependencies>
          <dependency>
            <groupId>net.sf.saxon</groupId>
            <artifactId>Saxon-HE</artifactId>
            <version>${saxon.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <testDir>src/test/resources/xslt</testDir>
        </configuration>
        <executions>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>run-xspec</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>name.dmaus.schxslt</groupId>
        <artifactId>testsuite-maven-plugin</artifactId>
        <version>1.8.2</version>
        <dependencies>
          <dependency>
            <groupId>net.sf.saxon</groupId>
            <artifactId>Saxon-HE</artifactId>
            <version>${saxon.version}</version>
          </dependency>
          <!-- https://mvnrepository.com/artifact/xalan/xalan -->
          <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <version>${xalan.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <config>test-schematron.xml</config>
          <testsuites>
            <testsuite implementation="name.dmaus.schxslt.testsuite.maven.ConformanceTestsuiteSpec">
              <label>Schematron Conformance Tests for Xalan (${xalan.version})</label>
              <processorId>xalan</processorId>
              <skip>
                <param>include-baseuri-fixup</param>
                <param>extends-baseuri-fixup</param>
                <param>pattern-subordinate-document-01</param>
                <param>pattern-subordinate-document-02</param>
                <param>svrl-suppressed-rule</param>
                <param>rule-context-variable-01</param>
                <param>rule-context-variable-02</param>
                <param>rule-context-variable-03</param>
                <param>let-scope-phase-01</param>
                <param>let-scope-pattern-01</param>
              </skip>
            </testsuite>
            <testsuite implementation="name.dmaus.schxslt.testsuite.maven.ConformanceTestsuiteSpec">
              <label>Schematron Conformance Tests for xsltproc</label>
              <processorId>xsltproc</processorId>
              <skip>
                <param>include-baseuri-fixup</param>
                <param>extends-baseuri-fixup</param>
                <param>pattern-subordinate-document-01</param>
                <param>pattern-subordinate-document-02</param>w
                <param>svrl-suppressed-rule</param>
                <param>rule-context-variable-01</param>
                <param>rule-context-variable-02</param>
                <param>rule-context-variable-03</param>
                <param>let-scope-phase-01</param>
                <param>let-scope-pattern-01</param>
              </skip>
            </testsuite>
            <testsuite implementation="name.dmaus.schxslt.testsuite.maven.ConformanceTestsuiteSpec">
              <label>Schematron Conformance Tests for Saxon HE (${saxon.version})</label>
              <processorId>saxon</processorId>
              <skip>
                <param>let-scope-phase-01</param>
                <param>let-scope-pattern-01</param>
                <param>rule-abstract-02</param>
              </skip>
            </testsuite>
            <testsuite implementation="name.dmaus.schxslt.testsuite.maven.ConformanceTestsuiteSpec">
              <label>Schematron Conformance Tests for Saxon HE (${saxon.version}) using the micro pipeline</label>
              <processorId>saxon-pipeline</processorId>
              <skip>
                <param>let-scope-phase-01</param>
                <param>let-scope-pattern-01</param>
                <param>rule-abstract-02</param>
              </skip>
            </testsuite>
            <testsuite implementation="name.dmaus.schxslt.testsuite.maven.ConformanceTestsuiteSpec">
              <label>Schematron Conformance Tests for Saxon HE (${saxon.version}), XSLT 3.0</label>
              <processorId>saxon.xslt3</processorId>
              <skip>
                <param>let-scope-phase-01</param>
                <param>let-scope-pattern-01</param>
                <param>rule-abstract-02</param>
              </skip>
            </testsuite>
            <testsuite implementation="name.dmaus.schxslt.testsuite.maven.ConformanceTestsuiteSpec">
              <label>Schematron Conformance Tests for Saxon HE (${saxon.version}) using the micro pipeline, XSLT 3.0</label>
              <processorId>saxon-pipeline.xslt3</processorId>
              <skip>
                <param>let-scope-phase-01</param>
                <param>let-scope-pattern-01</param>
                <param>rule-abstract-02</param>
              </skip>
            </testsuite>
            <testsuite implementation="name.dmaus.schxslt.testsuite.maven.DirectoryTestsuiteSpec">
              <label>Bugs and features w/ Xalan (${xalan.version})</label>
              <directory>src/test/schematron</directory>
              <processorId>xalan</processorId>
              <skip>
                <param>svrl-suppressed-rule</param>
              </skip>
            </testsuite>
            <testsuite implementation="name.dmaus.schxslt.testsuite.maven.DirectoryTestsuiteSpec">
              <label>Bugs and features w/ Saxon (${saxon.version})</label>
              <directory>src/test/schematron</directory>
              <processorId>saxon</processorId>
            </testsuite>
            <testsuite implementation="name.dmaus.schxslt.testsuite.maven.DirectoryTestsuiteSpec">
              <label>Bugs and features w/ Saxon (${saxon.version}) using the micro pipeline</label>
              <directory>src/test/schematron</directory>
              <processorId>saxon</processorId>
            </testsuite>
            <testsuite implementation="name.dmaus.schxslt.testsuite.maven.DirectoryTestsuiteSpec">
              <label>Bugs and features w/ Saxon (${saxon.version}), XSLT 3.0</label>
              <directory>src/test/schematron</directory>
              <processorId>saxon.xslt3</processorId>
            </testsuite>
            <testsuite implementation="name.dmaus.schxslt.testsuite.maven.DirectoryTestsuiteSpec">
              <label>Bugs and features w/ Saxon (${saxon.version}) using the micro pipeline, XSLT 3.0</label>
              <directory>src/test/schematron</directory>
              <processorId>saxon.xslt3</processorId>
            </testsuite>
            <testsuite implementation="name.dmaus.schxslt.testsuite.maven.DirectoryTestsuiteSpec">
              <label>Bugs and features w/ xsltproc</label>
              <directory>src/test/schematron</directory>
              <processorId>xsltproc</processorId>
              <skip>
                <param>svrl-suppressed-rule</param>
              </skip>
            </testsuite>
          </testsuites>
        </configuration>
        <executions>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>test-schematron</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <!-- Build a ZIP file with only the XSLT stylesheets -->
          <execution>
            <id>zip</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/assembly/xslt-only.xml</descriptor>
              </descriptors>
              <finalName>${project.artifactId}-${project.version}</finalName>
            </configuration>
          </execution>
          <!-- Build a ZIP file with only XProc pipelines and XSLT stylesheets -->
          <execution>
            <id>xproc</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/assembly/xproc.xml</descriptor>
              </descriptors>
              <finalName>${project.artifactId}-${project.version}</finalName>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>

  </build>

</project>
