diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index dd03b27b..562b5c18 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -12,11 +12,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - uses: actions/setup-java@v5 # the log states the default ~/.m2/toolchains.xml is being created pointing to the JDK + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 # the log states the default ~/.m2/toolchains.xml is being created pointing to the JDK with: distribution: 'adopt' # for latest JDKs use temurin https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/ - java-version: '17' + java-version: '11' cache: 'maven' #cache/restore any dependencies to improve the workflow execution time - name: Build with Maven run: mvn -B package --file pom.xml \ No newline at end of file diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index 789676f9..e91e41c8 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -13,7 +13,7 @@ jar UTF-8 - ${java.version} + 11 @@ -118,8 +118,8 @@ - ${java.version} - ${java.version} + 11 + 11 @@ -209,7 +209,7 @@ - ${java.version} + 11 adopt diff --git a/library/pom.xml b/library/pom.xml index aacb32ae..67de4f9c 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -44,7 +44,7 @@ github -Xdoclint:none - ${java.version} + 11 true @@ -149,12 +149,6 @@ ${version.org.glassfish.jaxb} test - - org.slf4j - slf4j-simple - ${version.org.slf4j} - test - @@ -175,8 +169,8 @@ - ${java.version} - ${java.version} + 11 + 11 @@ -337,7 +331,7 @@ - ${java.version} + 11 adopt diff --git a/library/src/main/java/org/mustangproject/CII/CIIToUBL.java b/library/src/main/java/org/mustangproject/CII/CIIToUBL.java index 8480e81b..816f6992 100644 --- a/library/src/main/java/org/mustangproject/CII/CIIToUBL.java +++ b/library/src/main/java/org/mustangproject/CII/CIIToUBL.java @@ -3,7 +3,7 @@ package org.mustangproject.CII; import java.io.File; import java.io.Serializable; -import com.helger.diagnostics.error.list.ErrorList; +import com.helger.commons.error.list.ErrorList; import com.helger.en16931.cii2ubl.CIIToUBL23Converter; import com.helger.ubl23.UBL23Marshaller; diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java index 3e594830..dfdeac49 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java @@ -551,13 +551,9 @@ public class ZUGFeRDInvoiceImporter { NodeList lineDueNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET); BigDecimal duePayableAmount = null; if (lineDueNodes.getLength() > 0) { - String duePayableAmountStr=XMLTools.trimOrNull(lineDueNodes.item(0)); - if (duePayableAmountStr!=null) { - // Always set it, because it is used in the calculation below - duePayableAmount = new BigDecimal(duePayableAmountStr); - if (zpp instanceof CalculatedInvoice) { - ((CalculatedInvoice) zpp).setDuePayable(duePayableAmount); - } + duePayableAmount = new BigDecimal(XMLTools.trimOrNull(lineDueNodes.item(0))); + if (zpp instanceof CalculatedInvoice) { + ((CalculatedInvoice) zpp).setDuePayable(duePayableAmount); } } diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDVisualizer.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDVisualizer.java index 357a3b87..cf9551aa 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDVisualizer.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDVisualizer.java @@ -20,7 +20,7 @@ */ package org.mustangproject.ZUGFeRD; -import com.helger.base.io.stream.StreamHelper; +import com.helger.commons.io.stream.StreamHelper; import javax.xml.XMLConstants; import javax.xml.parsers.ParserConfigurationException; import org.apache.commons.io.IOUtils; diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/DXTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/DXTest.java index 04ed7fa0..5e4a5316 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/DXTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/DXTest.java @@ -335,8 +335,10 @@ public class DXTest extends MustangReaderTestCase { zf2p.setProfile(Profiles.getByName(EStandard.despatchadvice,"Pilot",1)); zf2p.generateXML(i); String theXML = new String(zf2p.getXML(), StandardCharsets.UTF_8); - try(BufferedWriter writer = new BufferedWriter(new FileWriter(TARGET_XML))) { + try { + BufferedWriter writer = new BufferedWriter(new FileWriter(TARGET_XML)); writer.write(theXML); + writer.close(); } catch (IOException e) { e.printStackTrace(); } diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/FXTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/FXTest.java index 1eeed4e6..fbe986b3 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/FXTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/FXTest.java @@ -62,8 +62,10 @@ public class FXTest extends TestCase { assertThat(theXML).valueByXPath("//*[local-name()='DuePayableAmount']") .asDouble() .isEqualTo(1); - try(BufferedWriter writer = new BufferedWriter(new FileWriter(TARGET_XML))) { + try { + BufferedWriter writer = new BufferedWriter(new FileWriter(TARGET_XML)); writer.write(theXML); + writer.close(); } catch (IOException e) { e.printStackTrace(); } diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/UBLTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/UBLTest.java index 0ecc0339..522ff9bd 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/UBLTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/UBLTest.java @@ -30,10 +30,8 @@ import java.text.ParseException; import java.util.Date; import org.assertj.core.api.Assertions; -import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; import org.mustangproject.BankDetails; import org.mustangproject.CII.CIIToUBL; import org.mustangproject.Contact; @@ -44,7 +42,6 @@ import org.mustangproject.TradeParty; import javax.xml.xpath.XPathExpressionException; -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class UBLTest extends ResourceCase { final String TARGET_XML = "./target/testout-1Lieferschein.xml"; diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java index 495a0563..3109f1b7 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java @@ -81,8 +81,10 @@ public class XRTest extends TestCase { assertThat(theXML).valueByXPath("//*[local-name()='DuePayableAmount']") .asDouble() .isEqualTo(1); - try(BufferedWriter writer = new BufferedWriter(new FileWriter(TARGET_XML))) { + try { + BufferedWriter writer = new BufferedWriter(new FileWriter(TARGET_XML)); writer.write(theXML); + writer.close(); } catch (IOException e) { e.printStackTrace(); } @@ -132,8 +134,10 @@ public class XRTest extends TestCase { assertThat(theXML).valueByXPath("//*[local-name()='DuePayableAmount']") .asDouble() .isEqualTo(1); - try(BufferedWriter writer = new BufferedWriter(new FileWriter(TARGET_EDGE_XML))) { + try { + BufferedWriter writer = new BufferedWriter(new FileWriter(TARGET_EDGE_XML)); writer.write(theXML); + writer.close(); } catch (IOException e) { e.printStackTrace(); } @@ -247,8 +251,10 @@ public class XRTest extends TestCase { assertThat(theXML).valueByXPath("//*[local-name()='DuePayableAmount']") .asDouble() .isEqualTo(1); - try(BufferedWriter writer = new BufferedWriter(new FileWriter(TARGET_XML))) { + try { + BufferedWriter writer = new BufferedWriter(new FileWriter(TARGET_XML)); writer.write(theXML); + writer.close(); } catch (IOException e) { e.printStackTrace(); } diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java index 3cddc296..3408b9a0 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java @@ -309,7 +309,9 @@ public class ZF2PushTest extends TestCase { String number = "123"; String priceStr = "3.00"; BigDecimal price = new BigDecimal(priceStr); - try(InputStream SOURCE_PDF = this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf")) { + try { + InputStream SOURCE_PDF = this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf"); + ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1(); ze.ignorePDFAErrors().load(SOURCE_PDF); ze.setProfile(Profiles.getByName("Extended")); @@ -357,7 +359,7 @@ public class ZF2PushTest extends TestCase { /*** - * you can activate intra community supply on item level + * you can activate intra community suppliy on item level */ public void testIntraCommunitySupplyItemExport() { diff --git a/pom.xml b/pom.xml index 84d1378b..ea91c007 100644 --- a/pom.xml +++ b/pom.xml @@ -28,8 +28,7 @@ github -Xdoclint:none - 17 - 17 + 11 true @@ -48,40 +47,40 @@ First the versions for plugins, then those for libraries. --> - 3.15.0 - 3.1.4 - 3.2.8 - 3.5.0 - 3.12.0 - 3.3.1 - 3.5.0 - 3.6.1 - 3.4.0 - 3.5.5 - 3.2.0 - 2.2.1 + 3.13.0 + 3.0.0-M1 + 1.6 + 3.4.2 + 3.0.1 + 2.5.3 + 3.1.0 + 3.5.3 + 3.3.1 + 3.5.3 + 3.1.0 + 1.9.5 1.0.0 - 9.1.1 + 8.0.0 1.7.0 - 1.5.32 - 2.21.1 - 3.1.7 - 9.1.1 - 1.11.0 - 2.21.0 - 4.0.5 - 12.9 - 3.0.7 + 1.5.18 + 2.17.3 + 2.3.1 + 8.0.6 + 1.10.0 + 2.20.0 + 4.0.2 + 12.8 + 3.0.7 2.11 3.1.12 - 2.2.0 - 4.0.7 + 2.1.5 + 4.0.5 5.13.4 2.0-rc1 2.0.17 - 1.28.2 - 2.11.0 + 1.26.5 + 2.10.3 @@ -245,7 +244,7 @@ - 17 + 11 adopt diff --git a/validator/pom.xml b/validator/pom.xml index fb1dc486..65d797aa 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -26,7 +26,7 @@ UTF-8 false - ${java.version} + 11 @@ -141,8 +141,8 @@ - ${java.version} - ${java.version} + 11 + 11 @@ -273,7 +273,7 @@ - ${java.version} + 11 adopt @@ -293,7 +293,7 @@ com.helger.maven ph-schematron-maven-plugin - ${version.com.helger.maven.schematron} + ${version.com.helger.maven} ${basedir}/src/main/resources/schematron ${basedir}/src/main/resources/xslt diff --git a/validator/src/main/java/org/mustangproject/validator/PDFValidator.java b/validator/src/main/java/org/mustangproject/validator/PDFValidator.java index 5d0d348d..993a2d0a 100644 --- a/validator/src/main/java/org/mustangproject/validator/PDFValidator.java +++ b/validator/src/main/java/org/mustangproject/validator/PDFValidator.java @@ -113,7 +113,7 @@ public class PDFValidator extends Validator { ItemDetails itemDetails = ItemDetails.fromValues(pdfFilename); inputStream.mark(Integer.MAX_VALUE); processorResult = processor.process(itemDetails, inputStream); - pdfReport = processorResult.getValidationResults().get(0).toString().replaceAll( + pdfReport = processorResult.getValidationResult().toString().replaceAll( "<\\?xml version=\"1\\.0\" encoding=\"utf-8\"\\?>", "" ); @@ -330,11 +330,11 @@ public class PDFValidator extends Validator { //end final long endTime = Calendar.getInstance().getTimeInMillis(); - if (!processorResult.getValidationResults().get (0).isCompliant()) { + if (!processorResult.getValidationResult().isCompliant()) { context.setInvalid(); } - PDFAFlavour pdfaFlavourFromValidationResult = processorResult.getValidationResults().get (0).getPDFAFlavour(); + PDFAFlavour pdfaFlavourFromValidationResult = processorResult.getValidationResult().getPDFAFlavour(); if (Arrays.stream(PDF_A_3_FLAVOURS) .noneMatch(pdfaFlavourFromValidationResult::equals)) { context.addResultItem( diff --git a/validator/src/main/java/org/mustangproject/validator/ZUGFeRDValidator.java b/validator/src/main/java/org/mustangproject/validator/ZUGFeRDValidator.java index f71b79dd..e6a319a4 100644 --- a/validator/src/main/java/org/mustangproject/validator/ZUGFeRDValidator.java +++ b/validator/src/main/java/org/mustangproject/validator/ZUGFeRDValidator.java @@ -24,15 +24,15 @@ import org.dom4j.DocumentException; import org.dom4j.DocumentHelper; import org.dom4j.io.OutputFormat; import org.dom4j.io.XMLWriter; -import org.mustangproject.XMLTools; import org.mustangproject.util.ByteArraySearcher; +import org.mustangproject.XMLTools; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.InputSource; -import com.helger.base.io.stream.StreamHelper; +import com.helger.commons.io.stream.StreamHelper; import jakarta.xml.bind.DatatypeConverter;