From 7dbcf6b6d41e39840ee9957ded8328fc119033fd Mon Sep 17 00:00:00 2001 From: apenski Date: Thu, 26 Oct 2017 15:24:18 +0200 Subject: [PATCH] Provide Maven based distribution packaging (#2) * Provide Maven based distribution packaging --- .gitignore | 2 +- configurations/xrechnung/assembly.xml | 23 ++ configurations/xrechnung/pom.xml | 71 ++++ configurations/xrechnung/resources/report.xsd | 265 ++++++++++++++ configurations/xrechnung/test/report.sch | 51 +++ configurations/xrechnung/test/report.sch.xsl | 337 ++++++++++++++++++ dist/assembly-full.xml | 57 +++ dist/assembly-standalone.xml | 37 ++ dist/pom.xml | 135 +++++++ pom.xml | 76 ++++ validationtool/pom.xml | 153 ++++---- .../src/main/assembly/assembly-full.xml | 32 ++ ...e-assembly.xml => assembly-standalone.xml} | 3 +- 13 files changed, 1148 insertions(+), 94 deletions(-) create mode 100644 configurations/xrechnung/assembly.xml create mode 100644 configurations/xrechnung/pom.xml create mode 100644 configurations/xrechnung/resources/report.xsd create mode 100644 configurations/xrechnung/test/report.sch create mode 100644 configurations/xrechnung/test/report.sch.xsl create mode 100644 dist/assembly-full.xml create mode 100644 dist/assembly-standalone.xml create mode 100644 dist/pom.xml create mode 100644 pom.xml create mode 100644 validationtool/src/main/assembly/assembly-full.xml rename validationtool/src/main/assembly/{standalone-assembly.xml => assembly-standalone.xml} (91%) diff --git a/.gitignore b/.gitignore index 21d3671..5625f84 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,7 @@ # Package Files # *.jar -src/test/generated +**/generated # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* diff --git a/configurations/xrechnung/assembly.xml b/configurations/xrechnung/assembly.xml new file mode 100644 index 0000000..bb3f3a4 --- /dev/null +++ b/configurations/xrechnung/assembly.xml @@ -0,0 +1,23 @@ + + konfiguration + + zip + + false + + + ${project.basedir} + / + + test/report.sch + test/report.sch.xsl + resources/report.xsd + + + + + + + \ No newline at end of file diff --git a/configurations/xrechnung/pom.xml b/configurations/xrechnung/pom.xml new file mode 100644 index 0000000..53356bf --- /dev/null +++ b/configurations/xrechnung/pom.xml @@ -0,0 +1,71 @@ + + + + + 4.0.0 + + pom + + de.kosit + validationtool-base + 1.0.0 + ../../ + + + KoSIT XRechnung Konfiguration + + + xrechnung + KoSIT XML Prüftool zur Prüfung von XML Dateien gegenüber definierten Szenarien. + + + + + + + maven-assembly-plugin + 3.1.0 + + + assemble + package + + single + + + + assembly.xml + + true + false + + target/ + target/assembly/work + + + + + + + + + \ No newline at end of file diff --git a/configurations/xrechnung/resources/report.xsd b/configurations/xrechnung/resources/report.xsd new file mode 100644 index 0000000..0f4af32 --- /dev/null +++ b/configurations/xrechnung/resources/report.xsd @@ -0,0 +1,265 @@ + + + + + Dieses Schema beschreibt die Struktur von Berichten, mit denen die Prüfung und Bewertung elektronischer Dokumente + nachvollziehbar dokumentiert wird. + + + + + + + Prüfbericht (das einzige Wurzelelement in diesem Schema) + + + + + + Angaben zum Prüftool, mit welchem dieser Prüfbericht erstellt wurde + + + + + Der Zeitpunkt, an dem die Prüfung des Dokuments begann. + + + + + Angaben zur eindeutigen Identifikation des geprüften Dokumentes + + + + + + Dieses Kindelement gibt an, dass das für das geprüfte Dokument ein Szenario (ein Dokumenttyp) + erkannt wurde, für welches weitere Prüfschritte durchgeführt wurden. + + + + + + + In diesem Element können ausgewählte extrahierte Inhaltsdaten des geprüften Dokuments in + strukturierter Form abgelegt werden. + + + + + Für jeden durchgeführten Validierungsschrittes (z. B. einer Prüfung + gegen eine Schematron-Datei) wird ein entsprechendes + validationStepResult-Element angelegt. + + + + + + + + Dieses Kindelement gibt an, dass das für das geprüfte Dokument kein Szenario + erkannt wurde. + + + + + + Angaben zu einer ggf. fehlgeschlagen Prüfung auf XML-Wohlgeformtheit + + + + + + + + + Dieses Kindelement enthält eine Empfehlung zur Annahme oder Ablehnung des geprüften Dokuments auf Grundlage der Validierungsergebnisse. + + + + + + Dieses Attribut ist genau dann 'true', wenn ein Szenario (Dokumenttyp) erkannt wurde und das Attribut valid für alle zugeordneten + Validierungsschritt-Ergebnisse (rep:scenarioMatched/rep:validationStepResult) den Wert 'true' hat. + + + + + Die Version dieses Dokumenttyps (Prüfbericht). + + + + + + + + + + + + + + + + + + + + + + + + + + Die Empfehlung zum weiteren Umgang mit dem Dokument. + + + + Die Existenz dieses Kindelements bedeutet, dass die Weiterverarbeitung des geprüften Dokuments empfohlen + wird. + + + + + Die Existenz dieses Kindelements bedeutet, dass die Ablehnung des geprüften Dokuments empfohlen + wird. + + + + + + + + + Dient der eindeutigen Identifikation des geprüften Dokuments anhand einer Dokumentenreferenz und seines Hashwertes. + + + + + Angaben zum Hashwert des geprüften Dokuments. + + + + + + Bezeichnung des Algorithmus, mit welchem der Hashwert berechnet wurde. + + + + + Der Hashwert des geprüften Dokuments bei Anwendung des bezeichneten Algorithmus. + + + + + + + + Eine von der prüfenden Organisationseinheit festgelegte, möglichst eindeutige Referenz des geprüften + Dokuments. + + + + + + + + + + Prüfberichtsweit eindeutige Id dieser spezifischen Validierungsmeldung + + + + + (Fehler-)Code der Validierungsmeldung, wie er sich aus der zugrundeliegenden + Prüfung ergibt. + + + + + Art der Meldung: Fehler (error), Warnung (warning) oder Information + (information). + + + + + Zeilennummer der auslösenden Stelle im geprüften Dokument (falls bekannt). + + + + + Spaltennummer der auslösenden Stelle im geprüften Dokument (falls bekannt). + + + + + XPath-Ausdruck, welcher die auslösenden Stelle im geprüften Dokument eindeutig + bestimmt (falls bekannt). + + + + + + + + + + Ein oder mehrere HTML-Dokumente, welche die Empfehlung zum weiteren Umgang mit dem Dokument + begründen. Die HTML-Dokumente müssen im Attribut 'data-report-type' des Wurzelelements eine Typ-ID für den Bericht tragen. + + + + + + + + + + + + + + + + Resource(n), mit welchen dieser Validierungsschritt durchgeführt wurde. Dies ist + ein Zitat aus der zugrunde liegenden Prüftoolkonfiguration. + + + + + Eine Meldung, welche sich aus validierungsschritt ergeben hat. + + + + + + Prüfberichtsweit eindeutige Id dieser spezifischen Validierungsergebnisse. + + + + + Konformitätsbewertung der Ergebnisse dieses Validierungsschrittes. Das Attribut ist + genau dann 'true', wenn kein Kindelement message mit error level 'error' oder 'warning' vorliegt. + + + + + + + + + + + + + + + + + + + + + + diff --git a/configurations/xrechnung/test/report.sch b/configurations/xrechnung/test/report.sch new file mode 100644 index 0000000..9846493 --- /dev/null +++ b/configurations/xrechnung/test/report.sch @@ -0,0 +1,51 @@ + + + + + + + + + VARL version must be 1.0.0. + + + + + + If no scenario matched, then the report must be flagged invalid. + + + If any validation step has been flagged invalid, then the report must be flagged invalid. + + + If a scenario matched and no validation step has been flagged invalid, then the report must be flagged valid. + + + + + + + If xsd is valid then schematron checks have to be performed. + + + If xsd is invalid then schematron checks must not be performed. + + + + + + If a validation step has errors or warnings, it must be flagged invalid. + + + If a validation step has no errors or warnings, it must be flagged valid. + + + + + + Some kind of error location must be given. + + + + \ No newline at end of file diff --git a/configurations/xrechnung/test/report.sch.xsl b/configurations/xrechnung/test/report.sch.xsl new file mode 100644 index 0000000..6bc78b7 --- /dev/null +++ b/configurations/xrechnung/test/report.sch.xsl @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + / + + + + + + *: + + [namespace-uri()=' + + '] + + + + [ + + ] + + + + / + + @ + + + @*[local-name()=' + + ' and namespace-uri()=' + + '] + + + + + + + + + / + + + [ + + ] + + + + /@ + + + + + + + / + + + [ + + ] + + + + /@ + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + U + + U + + + + U. + + n + + + + U. + + _ + + _ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Schematron rule violation on VARL version must be 1.0.0. (@varlVersion='1.0.0') + + + + + + + + + + + + + + + + + + + + Schematron rule violation on If no scenario matched, then the report must be flagged invalid. (@valid='false') + + + + + + + + + + + + + Schematron rule violation on If any validation step has been flagged invalid, then the report must be flagged invalid. (@valid='false') + + + + + + + + + + + + + Schematron rule violation on If a scenario matched and no validation step has been flagged invalid, then the report must be flagged valid. (@valid='true') + + + + + + + + + + + + + + + + + + + + Schematron rule violation on If xsd is valid then schematron checks have to be performed. (rep:validationStepResult[@id = 'val-sch.1']) + + + + + + + + + + + + + Schematron rule violation on If xsd is invalid then schematron checks must not be performed. (empty(rep:validationStepResult[@id = 'val-sch.1'])) + + + + + + + + + + + + + + + + + + + + Schematron rule violation on If a validation step has errors or warnings, it must be flagged invalid. (@valid = 'false') + + + + + + + + + + + + + Schematron rule violation on If a validation step has no errors or warnings, it must be flagged valid. (@valid = 'true') + + + + + + + + + + + + + + + + + + + + Schematron rule violation on Some kind of error location must be given. (@lineNumber or @xpathLocation) + + + + + + + + + diff --git a/dist/assembly-full.xml b/dist/assembly-full.xml new file mode 100644 index 0000000..5ded812 --- /dev/null +++ b/dist/assembly-full.xml @@ -0,0 +1,57 @@ + + full + + dir + zip + + false + + + ${project.parent.basedir} + / + + README* + LICENSE* + NOTICE* + + + + ${project.build.directory}/xrechnung + / + + + + + / + false + runtime + ${artifact.artifactId}-${artifact.baseVersion}-${artifact.classifier}.${artifact.extension} + + ${project.groupId}:validationtool:jar:*:standalone + ${project.groupId}:validationtool:jar:*:full + ${project.groupId}:validationtool:jar:*:sources + + + + / + false + runtime + ${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension} + + ${project.groupId}:validationtool + + + + /libs + false + runtime + ${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension} + + ${project.groupId}:validationtool + + + + + \ No newline at end of file diff --git a/dist/assembly-standalone.xml b/dist/assembly-standalone.xml new file mode 100644 index 0000000..254bc49 --- /dev/null +++ b/dist/assembly-standalone.xml @@ -0,0 +1,37 @@ + + standalone + + dir + zip + + false + + + ${project.parent.basedir} + / + + README* + LICENSE* + NOTICE* + + + + ${project.build.directory}/xrechnung + / + + + + + / + false + runtime + ${artifact.artifactId}-${artifact.baseVersion}-${artifact.classifier}.${artifact.extension} + + ${project.groupId}:validationtool:jar:*:standalone + ${project.groupId}:validationtool:jar:*:sources + + + + \ No newline at end of file diff --git a/dist/pom.xml b/dist/pom.xml new file mode 100644 index 0000000..5aff887 --- /dev/null +++ b/dist/pom.xml @@ -0,0 +1,135 @@ + + + + + 4.0.0 + + de.kosit + validationtool-base + 1.0.0 + ../ + + validationtool-dist + pom + KoSIT XML Prüftool Distribution + KoSIT XML Prüftool zur Prüfung von XML Dateien gegenüber definierten Szenarien. + + + + UTF-8 + + + + + de.kosit + validationtool + ${project.version} + + + de.kosit + validationtool + ${project.version} + standalone + + + de.kosit + validationtool + ${project.version} + sources + + + de.kosit + validationtool + ${project.version} + full + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.9 + + + unpack + package + + unpack + + + ${project.build.directory}/xrechnung + + + ${project.groupId} + xrechnung + ${project.version} + zip + + + + + + + + maven-assembly-plugin + 3.1.0 + + + standalone + package + + single + + + + assembly-standalone.xml + + true + true + target/ + target/assembly/standalone + + + + full + package + + single + + + + assembly-full.xml + + true + true + target/ + target/assembly/full + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..85a163b --- /dev/null +++ b/pom.xml @@ -0,0 +1,76 @@ + + + + + 4.0.0 + + 3.0 + + de.kosit + validationtool-base + 1.0.0 + pom + KoSIT XML Prüftool + KoSIT XML Prüftool zur Prüfung von XML Dateien gegenüber definierten Szenarien. + + + andreas.penski + Andreas Penski + ]init[ AG + https://www.init.de + + + fabian.buettner + Fabian Büttner + KoSIT + http://www.kosit.de + + + + + + UTF-8 + + + + validationtool + configurations/xrechnung + dist + + + + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + v@{project.version} + + + + + + https://github.com/itplr-kosit/validationtool.git + + + \ No newline at end of file diff --git a/validationtool/pom.xml b/validationtool/pom.xml index f11e643..0ee724a 100644 --- a/validationtool/pom.xml +++ b/validationtool/pom.xml @@ -25,26 +25,17 @@ 3.0 - de.kosit - validationtool - 1.0.0 - KoSIT XML Prüftool - KoSIT XML Prüftool zur Prüfung von XML Dateien gegenüber definierten Szenarien. - - - andreas.penski - Andreas Penski - ]init[ AG - https://www.init.de - - - fabian.buettner - Fabian Büttner - KoSIT - http://www.kosit.de - - + KoSIT XML Prüftool Implementierung + + + de.kosit + validationtool-base + 1.0.0 + ../ + + validationtool + KoSIT XML Prüftool zur Prüfung von XML Dateien gegenüber definierten Szenarien. UTF-8 @@ -52,7 +43,6 @@ 1.16.16 9.7.0-15 1.7.25 - @@ -78,6 +68,12 @@ commons-cli 1.4 + + org.slf4j + slf4j-simple + ${version.slf4j} + true + org.apache.commons @@ -96,12 +92,7 @@ 4.12 test - - org.slf4j - slf4j-simple - 1.7.25 - test - + org.apache.commons commons-io @@ -111,72 +102,6 @@ - - - full-distribution - - - - maven-jar-plugin - 2.3.1 - - full - - - - - - - standalone - - - org.slf4j - slf4j-simple - 1.7.22 - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - package - - single - - - - - - de.kosit.validationtool.cmd.CommandLineApplication - - - - - src/main/assembly/standalone-assembly.xml - - - - - - - - maven-jar-plugin - 2.3.1 - - - default-jar - none - - - - - - - - @@ -214,6 +139,50 @@ + + org.apache.maven.plugins + maven-assembly-plugin + + + standalone + package + + single + + + + + + de.kosit.validationtool.cmd.CommandLineApplication + + + + + src/main/assembly/assembly-standalone.xml + + + + + full + package + + single + + + + + + de.kosit.validationtool.cmd.CommandLineApplication + + + + + src/main/assembly/assembly-full.xml + + + + + diff --git a/validationtool/src/main/assembly/assembly-full.xml b/validationtool/src/main/assembly/assembly-full.xml new file mode 100644 index 0000000..5a50ed3 --- /dev/null +++ b/validationtool/src/main/assembly/assembly-full.xml @@ -0,0 +1,32 @@ + + + + full + + jar + + false + + + ${project.build.directory}/classes + / + + + diff --git a/validationtool/src/main/assembly/standalone-assembly.xml b/validationtool/src/main/assembly/assembly-standalone.xml similarity index 91% rename from validationtool/src/main/assembly/standalone-assembly.xml rename to validationtool/src/main/assembly/assembly-standalone.xml index 3a33cff..199357f 100644 --- a/validationtool/src/main/assembly/standalone-assembly.xml +++ b/validationtool/src/main/assembly/assembly-standalone.xml @@ -31,7 +31,8 @@ - ${project.build.outputDirectory} + ${project.build.directory}/classes + /