ZUGFeRD / mustangproject

Open Source Java e-Invoicing library, validator and tool (Factur-X/ZUGFeRD, UNCEFACT/CII XRechnung)
http://www.mustangproject.org
Apache License 2.0
242 stars 137 forks source link

Be able to validate XRechnung/UBL files #337

Closed jstaerk closed 5 months ago

jstaerk commented 1 year ago

currently only CII is supported

jstaerk commented 7 months ago

@5now when I use this

package org.example;

import com.helger.schematron.ISchematronResource;
import com.helger.schematron.svrl.SVRLMarshaller;
import com.helger.schematron.svrl.jaxb.SchematronOutputType;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import com.helger.schematron.xslt.SchematronResourceXSLT;
import javax.xml.transform.stream.StreamSource;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import java.io.StringReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;

public class Main {
    public static void main(String[] args) {

        int firedRules=0;
        int failedRules=0;
        String xml=null;
        try {
            xml= Files.readString(Paths.get("C:\\Users\\jstaerk\\workspace\\phstest\\src\\main\\resources\\01.01a-INVOICE_ubl.xml"), StandardCharsets.UTF_8);

        } catch (Exception e) {
            e.printStackTrace();
        }
        String xsltFilename="EN16931-UBL-validation.xslt";
        ISchematronResource aResSCH = null;

        aResSCH = SchematronResourceXSLT.fromClassPath(xsltFilename);

        if (aResSCH != null) {
            if (!aResSCH.isValidSchematron()) {
                throw new IllegalArgumentException(xsltFilename + " is invalid Schematron!");
            }

            SchematronOutputType sout=null;
            try {
                sout = aResSCH
                        .applySchematronValidationToSVRL(new StreamSource(new StringReader(xml)));
            } catch (final Exception e) {
                e.printStackTrace();
            }
            Document SVRLReport = new SVRLMarshaller().getAsDocument(sout);
            XPath xPath = XPathFactory.newInstance().newXPath();
            String expression = "//*[local-name() = 'failed-assert']";
            NodeList failedAsserts = null;
            try {
                failedAsserts = (NodeList) xPath.compile(expression).evaluate(SVRLReport, XPathConstants.NODESET);

                String thisFailText = "";
                String thisFailID = "";
                String thisFailTest = "";
                String thisFailLocation = "";
                if (failedAsserts.getLength() > 0) {

                    for (int nodeIndex = 0; nodeIndex < failedAsserts.getLength(); nodeIndex++) {
                        //nodes.item(i).getTextContent())) {
                        Node currentFailNode = failedAsserts.item(nodeIndex);
                        if (currentFailNode.getAttributes().getNamedItem("id") != null) {
                            thisFailID = " [ID " + currentFailNode.getAttributes().getNamedItem("id").getNodeValue() + "]";
                        }
                        if (currentFailNode.getAttributes().getNamedItem("test") != null) {
                            thisFailTest = currentFailNode.getAttributes().getNamedItem("test").getNodeValue();
                        }
                        if (currentFailNode.getAttributes().getNamedItem("location") != null) {
                            thisFailLocation = currentFailNode.getAttributes().getNamedItem("location").getNodeValue();
                        }

                        NodeList failChilds = currentFailNode.getChildNodes();
                        for (int failChildIndex = 0; failChildIndex < failChilds.getLength(); failChildIndex++) {
                            if (failChilds.item(failChildIndex).getLocalName() != null) {

                                if (failChilds.item(failChildIndex).getLocalName().equals("text")) {
                                    //  if (itemChilds.item(failChildIndex).getAttributes().getNamedItem("schemeID") != null) {
                                    thisFailText = failChilds.item(failChildIndex).getTextContent();

                                }
                            }
                        }

                        System.out.println( thisFailText + thisFailID + " from " + xsltFilename + ")"+thisFailLocation+thisFailTest);
                        failedRules++;

                    }

                }

            } catch (XPathExpressionException e) {
                 e.printStackTrace();            }
            expression = "//*[local-name() = 'fired-rule']";
            NodeList firedAsserts = null;
            try {
                firedAsserts = (NodeList) xPath.compile(expression).evaluate(SVRLReport, XPathConstants.NODESET);
                firedRules = firedAsserts.getLength();
            } catch (XPathExpressionException e) {
                e.printStackTrace();
            }
            int activePatterns=0;
            expression = "//*[local-name() = 'active-pattern']";
            firedAsserts = null;
            try {
                firedAsserts = (NodeList) xPath.compile(expression).evaluate(SVRLReport, XPathConstants.NODESET);
                activePatterns = firedAsserts.getLength();
            } catch (XPathExpressionException e) {
                e.printStackTrace();
            }

            if (firedRules+activePatterns == 0) {
                System.out.println("No rules fired");

            }
            //  for (String currentString : sout.getText()) {
            // schematronValidationString += "<output>" + currentString + "</output>";
            // }

            // schematronValidationString += new SVRLMarshaller ().getAsString (sout);
            // returns the complete SVRL

        }

    }
}

with this gradle file

plugins {
    id 'java'
}

group = 'org.example'
version = '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    implementation group: 'com.helger.schematron', name: 'ph-schematron-validator', version: '8.0.0'
    implementation group: 'com.helger.schematron', name: 'ph-schematron-xslt', version: '8.0.0'
    implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.1'
    implementation 'com.sun.xml.bind:jaxb-impl:4.0.0'
    implementation 'com.helger.commons:ph-commons:11.1.6'
    testImplementation platform('org.junit:junit-bom:5.9.1')
    testImplementation 'org.junit.jupiter:junit-jupiter'
}

test {
    useJUnitPlatform()
}

it works but in Mustang's \validator\src\main\java\org\mustangproject\validator\XMLValidator.java sout = aResSCH .applySchematronValidationToSVRL(new StreamSource(new StringReader(xml))); mysteriously sets sout to null?

jstaerk commented 7 months ago

but with this pom the problem is reproductible. One can also set java version to 11 if you want to keep files.readstring.

<?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>org.mustangproject</groupId>
    <artifactId>validator</artifactId>
    <name>Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung)</name>

    <packaging>jar</packaging>

    <version>2.10.1-SNAPSHOT</version>
    <repositories>
        <repository>
            <!-- for jargs -->
            <id>sonatype-oss-public</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.deploy.skip>false
        </maven.deploy.skip><!-- do deploy to maven central, parent project does not and inherits -->
        <maven.compiler.compilerVersion>8</maven.compiler.compilerVersion>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>

            <java.version>8</java.version>

    </properties>
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>library</artifactId>
            <version>2.10.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin -->
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.2.5</version>
        </dependency>

        <!-- for java9 -->
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.1</version>
        </dependency>
        <!-- for xml pretty print -->
        <dependency>
            <groupId>org.dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>2.1.3</version>
        </dependency>
        <!-- for ph-schematron -->
        <dependency>
            <groupId>com.helger.commons</groupId>
            <artifactId>ph-commons</artifactId>
            <version>11.1.6</version>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>4.0.1</version>
        </dependency>
        <!-- /for ph-schematron -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.13</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>1.2.13</version>
        </dependency>

        <dependency>
            <!-- This library is needed so that logback stderr output is sent to, well, stderr, otherwise it lands in stdout -->
            <groupId>org.codehaus.janino</groupId>
            <artifactId>janino</artifactId>
            <version>3.1.7</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.googlecode.slf4j-maven-plugin-log/slf4j-maven-plugin-log -->
        <dependency>
            <groupId>com.googlecode.slf4j-maven-plugin-log</groupId>
            <artifactId>slf4j-maven-plugin-log</artifactId>
            <version>1.0.0</version>
        </dependency>
        <!-- Verapdf plugin <dependency> <groupId>org.verapdf</groupId> <artifactId>core</artifactId>
              <version>1.6.2</version> </dependency> -->
        <!-- embedded verapdf -->
        <dependency>
            <groupId>org.verapdf</groupId>
            <artifactId>validation-model</artifactId>
            <version>1.22.2</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.helger/ph-schematron -->
        <dependency>
            <groupId>com.helger.schematron</groupId>
            <artifactId>ph-schematron-validator</artifactId>
            <version>8.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.helger.schematron</groupId>
            <artifactId>ph-schematron-xslt</artifactId>
            <version>8.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.mustangproject</groupId>
            <artifactId>library</artifactId>
            <version>2.10.0</version>
        </dependency>
        <dependency>
            <groupId>org.xmlunit</groupId>
            <artifactId>xmlunit-core</artifactId>
            <version>2.9.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.xmlunit</groupId>
            <artifactId>xmlunit-assertj</artifactId>
            <version>2.9.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.riversun</groupId>
            <artifactId>bigdoc</artifactId>
            <version>0.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.9.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <version>5.9.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <!-- mvn help:effective-pom will otherwise tell it just defaults
                             to 2.3.2 - which does not release in the maven repo, and neither shows any
                             error message :-( -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.2.5</version>
                </plugin>

            </plugins>
        </pluginManagement>
        <plugins>            <!-- allow getImplementationVersion for the pom.xml -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <excludes>
                        <exclude>**/logback.xml</exclude>
                    </excludes>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <!-- http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven
                             mvn clean compile assembly:single -->
                    <!-- or whatever version you use -->
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
            <!-- /ZUV -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.4.3</version>
                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <minimizeJar>false</minimizeJar>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>LICENSE</exclude>
                                <exclude>NOTICE</exclude>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                        <filter>
                            <artifact>log4j:log4j</artifact>
                            <includes>
                                <include>**</include>
                            </includes>
                        </filter>
                        <filter>
                            <artifact>commons-logging:commons-logging</artifact>
                            <includes>
                                <include>**</include>
                            </includes>
                        </filter>
                        <filter>
                            <artifact>com.sun.xml.bind:jaxb-impl</artifact>
                            <includes>
                                <include>**</include>
                            </includes>
                        </filter>
                    </filters>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <artifactSet>
                                <excludes/>
                            </artifactSet>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>copy-zf-schematron-xml-dependencies</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>

                        <configuration>
                            <outputDirectory>${basedir}/src/main/resources/xslt/ZF_221/</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${basedir}/src/main/resources/schematron/ZF_221/</directory>
                                    <includes>
                                        <include>**/*.xml</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <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>
    <developers>
        <developer>
            <name>Jochen Stärk</name>
            <email>jstaerk@usegroup.de</email>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
        </developer>
    </developers>
    <profiles>
        <profile> <!-- enforce building binaries with Java 1.8 for Maven Central, otherwise using them e.g. as jar will
        throw a version exception, triggered automatically on mvn release:release (hopefully) and requires an according
        ~/.m2/toolchains.xml file, @see doc/development_documentation.md -->
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-toolchains-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>toolchain</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <toolchains>
                                <jdk>
                                    <version>8</version>
                                    <vendor>adopt</vendor>
                                </jdk>
                            </toolchains>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile> <!-- build the intermediate XSLT files from schematron takes 30min+ and is only required if there actually is a change in the schematron,
         -> invoke manually with commandline -P generateXSLTFromSchematron on demand -->
            <id>generateXSLTFromSchematron</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.helger.maven</groupId>
                        <artifactId>ph-schematron-maven-plugin</artifactId>
                        <version>5.6.0</version>
                        <configuration>
                            <schematronDirectory>${basedir}/src/main/resources/schematron</schematronDirectory>
                            <xsltDirectory>${basedir}/src/main/resources/xslt</xsltDirectory>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>convert</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
jstaerk commented 7 months ago

And with this pom it works again. Still not sure if its java 11, though

<?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>org.mustangproject</groupId>
    <artifactId>validator</artifactId>
    <name>Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung)</name>

    <packaging>jar</packaging>
    <version>2.10.1-SNAPSHOT</version>
    <repositories>
        <repository>
            <!-- for jargs -->
            <id>sonatype-oss-public</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.deploy.skip>false
        </maven.deploy.skip><!-- do deploy to maven central, parent project does not and inherits -->
        <maven.compiler.compilerVersion>11</maven.compiler.compilerVersion>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>

        <java.version>11</java.version>

    </properties>
    <dependencies>
        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin -->
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.2.5</version>
        </dependency>

        <!-- for xml pretty print -->
        <dependency>
            <groupId>org.dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>2.1.3</version>
        </dependency>
        <!-- for ph-schematron -->
        <dependency>
            <groupId>com.helger.commons</groupId>
            <artifactId>ph-commons</artifactId>
            <version>11.1.6</version>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>4.0.1</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>4.0.1</version>
        </dependency>

        <!-- /for ph-schematron -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.13</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>1.2.13</version>
        </dependency>

        <dependency>
            <!-- This library is needed so that logback stderr output is sent to, well, stderr, otherwise it lands in stdout -->
            <groupId>org.codehaus.janino</groupId>
            <artifactId>janino</artifactId>
            <version>3.1.7</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.googlecode.slf4j-maven-plugin-log/slf4j-maven-plugin-log -->
        <dependency>
            <groupId>com.googlecode.slf4j-maven-plugin-log</groupId>
            <artifactId>slf4j-maven-plugin-log</artifactId>
            <version>1.0.0</version>
        </dependency>
        <!-- Verapdf plugin <dependency> <groupId>org.verapdf</groupId> <artifactId>core</artifactId>
              <version>1.6.2</version> </dependency> -->
        <!-- embedded verapdf -->
        <dependency>
            <groupId>org.verapdf</groupId>
            <artifactId>validation-model</artifactId>
            <version>1.22.2</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.helger/ph-schematron -->
        <dependency>
            <groupId>com.helger.schematron</groupId>
            <artifactId>ph-schematron-validator</artifactId>
            <version>8.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.helger.schematron</groupId>
            <artifactId>ph-schematron-xslt</artifactId>
            <version>8.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.xmlunit</groupId>
            <artifactId>xmlunit-core</artifactId>
            <version>2.9.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.xmlunit</groupId>
            <artifactId>xmlunit-assertj</artifactId>
            <version>2.9.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.riversun</groupId>
            <artifactId>bigdoc</artifactId>
            <version>0.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.9.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <version>5.9.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <!-- mvn help:effective-pom will otherwise tell it just defaults
                             to 2.3.2 - which does not release in the maven repo, and neither shows any
                             error message :-( -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.2.5</version>
                </plugin>

            </plugins>
        </pluginManagement>
        <plugins>            <!-- allow getImplementationVersion for the pom.xml -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <excludes>
                        <exclude>**/logback.xml</exclude>
                    </excludes>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <!-- http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven
                             mvn clean compile assembly:single -->
                    <!-- or whatever version you use -->
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
            <!-- /ZUV -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.4.3</version>
                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <minimizeJar>false</minimizeJar>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>LICENSE</exclude>
                                <exclude>NOTICE</exclude>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                        <filter>
                            <artifact>log4j:log4j</artifact>
                            <includes>
                                <include>**</include>
                            </includes>
                        </filter>
                        <filter>
                            <artifact>commons-logging:commons-logging</artifact>
                            <includes>
                                <include>**</include>
                            </includes>
                        </filter>
                        <filter>
                            <artifact>com.sun.xml.bind:jaxb-impl</artifact>
                            <includes>
                                <include>**</include>
                            </includes>
                        </filter>
                    </filters>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <artifactSet>
                                <excludes/>
                            </artifactSet>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>copy-zf-schematron-xml-dependencies</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>

                        <configuration>
                            <outputDirectory>${basedir}/src/main/resources/xslt/ZF_221/</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${basedir}/src/main/resources/schematron/ZF_221/</directory>
                                    <includes>
                                        <include>**/*.xml</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <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>
    <developers>
        <developer>
            <name>Jochen Stärk</name>
            <email>jstaerk@usegroup.de</email>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
        </developer>
    </developers>
    <profiles>
        <profile> <!-- enforce building binaries with Java 1.8 for Maven Central, otherwise using them e.g. as jar will
        throw a version exception, triggered automatically on mvn release:release (hopefully) and requires an according
        ~/.m2/toolchains.xml file, @see doc/development_documentation.md -->
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-toolchains-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>toolchain</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <toolchains>
                                <jdk>
                                    <version>8</version>
                                    <vendor>adopt</vendor>
                                </jdk>
                            </toolchains>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile> <!-- build the intermediate XSLT files from schematron takes 30min+ and is only required if there actually is a change in the schematron,
         -> invoke manually with commandline -P generateXSLTFromSchematron on demand -->
            <id>generateXSLTFromSchematron</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.helger.maven</groupId>
                        <artifactId>ph-schematron-maven-plugin</artifactId>
                        <version>5.6.0</version>
                        <configuration>
                            <schematronDirectory>${basedir}/src/main/resources/schematron</schematronDirectory>
                            <xsltDirectory>${basedir}/src/main/resources/xslt</xsltDirectory>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>convert</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
phax commented 5 months ago

Was this issue eventually also affected by #393 ?

jstaerk commented 5 months ago

Was this issue eventually also affected by #393 ?

I would swear it was something different but I can't prove it, so lets assume you fixed this as well ;-)