<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>core</artifactId>
    <groupId>org.mustangproject</groupId>
    <version>2.19.1</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>validator</artifactId>
  <name>Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung)</name>
  <developers>
    <developer>
      <name>Jochen Stärk</name>
      <email>jstaerk@usegroup.de</email>
      <roles>
        <role>architect</role>
        <role>developer</role>
      </roles>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>${version.org.apache.maven.plugins.maven-release-plugin}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.org.apache.maven.plugins.maven-surefire-plugin}</version>
        <configuration>
          <runOrder>alphabetical</runOrder>
          <argLine>-Duser.timezone=UTC</argLine>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${version.org.apache.maven.plugins.maven-jar-plugin}</version>
        <configuration>
          <excludes>
            <exclude>**/logback.xml</exclude>
          </excludes>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.org.apache.maven.plugins.maven-compiler-plugin}</version>
        <configuration>
          <source>11</source>
          <target>11</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${version.org.apache.maven.plugins.maven-shade-plugin}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <excludes />
              </artifactSet>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <shadedArtifactAttached>true</shadedArtifactAttached>
          <minimizeJar>false</minimizeJar>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>LICENSE</exclude>
                <exclude>NOTICE</exclude>
                <exclude>META-INF/DEPENDENCIES</exclude>
                <exclude>META-INF/LICENSE</exclude>
                <exclude>META-INF/LICENSE.md</exclude>
                <exclude>META-INF/LICENSE.txt</exclude>
                <exclude>META-INF/NOTICE</exclude>
                <exclude>META-INF/NOTICE.md</exclude>
                <exclude>META-INF/NOTICE.txt</exclude>
                <exclude>META-INF/MANIFEST.MF</exclude>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
              </excludes>
            </filter>
            <filter>
              <artifact>commons-logging:commons-logging</artifact>
              <includes>
                <include>**</include>
              </includes>
            </filter>
            <filter>
              <artifact>jakarta.xml.bind:jakarta.xml.bind-api</artifact>
              <includes>
                <include>**</include>
              </includes>
            </filter>
          </filters>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${version.org.apache.maven.plugins.maven-resources-plugin}</version>
        <executions>
          <execution>
            <id>copy-zf-schematron-xml-dependencies</id>
            <phase>compile</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>src/main/resources/xslt/ZF_233/</outputDirectory>
              <resources>
                <resource>
                  <directory>${basedir}/src/main/resources/schematron/ZF_233/</directory>
                  <includes>
                    <include>**/*.xml</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release-sign-artifacts</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-toolchains-plugin</artifactId>
            <version>${version.org.apache.maven.plugins.maven-toolchains-plugin}</version>
            <executions>
              <execution>
                <goals>
                  <goal>toolchain</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <toolchains>
                <jdk>
                  <version>11</version>
                  <vendor>adopt</vendor>
                </jdk>
              </toolchains>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>generateXSLTFromSchematron</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.helger.maven</groupId>
            <artifactId>ph-schematron-maven-plugin</artifactId>
            <version>${version.com.helger.maven}</version>
            <executions>
              <execution>
                <goals>
                  <goal>convert</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <schematronDirectory>${basedir}/src/main/resources/schematron</schematronDirectory>
              <xsltDirectory>${basedir}/src/main/resources/xslt</xsltDirectory>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <repositories>
    <repository>
      <releases />
      <snapshots />
      <id>sonatype-oss-public</id>
      <url>https://oss.sonatype.org/content/groups/public/</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-core</artifactId>
      <version>2.10.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-assertj</artifactId>
      <version>2.10.3</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>assertj-core</artifactId>
          <groupId>org.assertj</groupId>
        </exclusion>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>5.13.4</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>opentest4j</artifactId>
          <groupId>org.opentest4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-platform-commons</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <version>5.13.4</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-platform-engine</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit</artifactId>
          <groupId>junit</groupId>
        </exclusion>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <maven.compiler.release>11</maven.compiler.release>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.deploy.skip>false</maven.deploy.skip>
  </properties>
</project>
