diff --git a/.config/checkstyle/checkstyle.xml b/.config/checkstyle/checkstyle.xml index a0d7f178..43b52907 100644 --- a/.config/checkstyle/checkstyle.xml +++ b/.config/checkstyle/checkstyle.xml @@ -52,6 +52,7 @@ + @@ -68,6 +69,11 @@ + + + + + @@ -93,7 +99,6 @@ - @@ -122,7 +127,13 @@ + + + + + + diff --git a/.config/pmd/ruleset.xml b/.config/pmd/ruleset.xml index 7a03f17c..88a7b5ae 100644 --- a/.config/pmd/ruleset.xml +++ b/.config/pmd/ruleset.xml @@ -10,16 +10,38 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -76,9 +98,6 @@ - - - @@ -114,17 +133,33 @@ + + + + + + + + + + + + + + + + - + diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index e1c1fd88..98443311 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,7 @@ name: 🐞 Bug description: Create a bug report for something that is broken labels: [bug] +type: bug body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml index 17b3e341..ff11d704 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.yml +++ b/.github/ISSUE_TEMPLATE/enhancement.yml @@ -1,6 +1,7 @@ name: ✨ Feature/Enhancement description: Suggest a new feature or enhancement labels: [enhancement] +type: feature body: - type: markdown attributes: diff --git a/.github/workflows/broken-links.yml b/.github/workflows/broken-links.yml index 8f98f1ad..16a3f376 100644 --- a/.github/workflows/broken-links.yml +++ b/.github/workflows/broken-links.yml @@ -19,7 +19,7 @@ jobs: - name: Link Checker id: lychee - uses: lycheeverse/lychee-action@v2 + uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2 with: fail: false # Don't fail on broken links, create an issue instead @@ -38,7 +38,7 @@ jobs: - name: Create Issue From File if: env.lychee_exit_code != 0 - uses: peter-evans/create-issue-from-file@v5 + uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5 with: issue-number: ${{ steps.find-issue.outputs.number }} title: Link Checker Report diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index 08181168..01edc3aa 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -127,7 +127,4 @@ jobs: name: pmd-report if-no-files-found: ignore path: | - target/site/*.html - target/site/css/** - target/site/images/logos/maven-feather.png - target/site/images/external.png + target/reports/** diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 236c0f59..8bd0f3c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: cache: 'maven' - name: Build with Maven - run: ./mvnw -B clean package + run: ./mvnw -B clean package -T2C - name: Check for uncommited changes run: | @@ -64,7 +64,7 @@ jobs: run: | mvnwPath=$(readlink -f ./mvnw) modules=("") # root - modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0')) + modules+=($(grep -oP '(?<=)[^<]+' 'pom.xml')) for i in "${modules[@]}" do echo "Processing $i/pom.xml" @@ -89,7 +89,7 @@ jobs: - name: Create Release id: create_release - uses: shogo82148/actions-create-release@v1 + uses: shogo82148/actions-create-release@e5f206451d4ace2da9916d01f1aef279997f8659 # v1 with: tag_name: v${{ steps.version.outputs.release }} release_name: v${{ steps.version.outputs.release }} @@ -121,7 +121,7 @@ jobs: git config --global user.name "GitHub Actions" git pull - - name: Set up JDK Apache Maven Central + - name: Set up JDK OSSRH uses: actions/setup-java@v4 with: # running setup-java again overwrites the settings.xml java-version: '17' @@ -132,7 +132,7 @@ jobs: gpg-passphrase: MAVEN_GPG_PASSPHRASE gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - - name: Publish to Apache Maven Central + - name: Publish to OSSRH run: ../mvnw -B deploy -Possrh -DskipTests env: MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} @@ -165,10 +165,11 @@ jobs: working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Deploy to Github pages - uses: peaceiris/actions-gh-pages@v4 + uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site + force_orphan: true after-release: runs-on: ubuntu-latest @@ -187,7 +188,7 @@ jobs: run: | mvnwPath=$(readlink -f ./mvnw) modules=("") # root - modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0')) + modules+=($(grep -oP '(?<=)[^<]+' 'pom.xml')) for i in "${modules[@]}" do echo "Processing $i/pom.xml" diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index c9d7ec78..dc672877 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -20,6 +20,6 @@ jobs: with: sparse-checkout: .github/labels.yml - - uses: EndBug/label-sync@v2 + - uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2 with: config-file: .github/labels.yml diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml index 6f9497eb..65f56b0d 100644 --- a/.github/workflows/update-from-template.yml +++ b/.github/workflows/update-from-template.yml @@ -202,7 +202,7 @@ jobs: GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }} run: | not_failed_conclusion="skipped|neutral|success" - not_relevant_app_slug="dependabot|github-pages|sonarcloud" + not_relevant_app_slug="dependabot|github-pages|sonarqubecloud" echo "Waiting for checks to start..." sleep 40s @@ -212,7 +212,7 @@ jobs: echo "Checking if update-branch-merged exists" git fetch - if [[ $(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then + if [[ $(git ls-remote --heads origin refs/heads/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then echo "Branch still exists; Continuing..." else echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing" diff --git a/.idea/externalDependencies.xml b/.idea/externalDependencies.xml new file mode 100644 index 00000000..78be5b8e --- /dev/null +++ b/.idea/externalDependencies.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b67a05e..d6a492b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,16 @@ -# 2.0.0 +# 2.0.1 +* Updated dependencies + * Including ``org.apache.httpcomponents.client5:httpclient5`` to ``5.4.3`` due to CVE-2025-27820 +# 2.0.0 * Now supports the CESOP-Format (and the DAC7-Format). * Uses a client that is auto generated by OpenAPI. This makes the library more robust for future changes of the API. * Certificates can now be defined with a ``SigningProvider``. # 1.0.3 - * ReportableSellerCreator can now create "Rechtsträger" like a company. # 1.0.2 - * The alias for the private key in the keystore is now configurable ( Properties: `certificate.keystore.private.key.alias` or Code: `BzstDipConfigurationBuilder#setKeyStorePrivateKeyAlias`) diff --git a/README.md b/README.md index 6bba8866..06606447 100644 --- a/README.md +++ b/README.md @@ -105,12 +105,17 @@ client.id=abcd1234-ab12-ab12-ab12-abcdef123456 ### Configuration -The client can be configured through a properties file (see [app.properties](./bzst-dip-java-client-demo/src/main/resources/app.properties) and [ApplicationWithConfigurationFromProperties.java](./bzst-dip-java-client-demo/src/main/java/software/xdev/ApplicationWithConfigurationFromProperties.java)) or by creating a configuration object (see [Application.java](./bzst-dip-java-client-demo/src/main/java/software/xdev/Application.java)). +The client can be configured through a properties file ( +see [app.properties](./bzst-dip-java-client-demo/src/main/resources/app.properties) +and [ApplicationWithConfigurationFromProperties.java](./bzst-dip-java-client-demo/src/main/java/software/xdev/ApplicationWithConfigurationFromProperties.java)) +or by creating a configuration object ( +see [ApplicationWithDac7.java](./bzst-dip-java-client-demo/src/main/java/software/xdev/ApplicationWithDac7.java)). ```java public static BzstDipConfiguration createConfiguration() { return new BzstDipConfigurationBuilder() + .setApplicationCode(BzstDipConfiguration.SupportedApplicationCode.DAC7) .setClientId("abcd1234-ab12-ab12-ab12-abcdef123456") .setTaxID("86095742719") .setTaxNumber("123") @@ -126,6 +131,12 @@ public static BzstDipConfiguration createConfiguration() } ``` +Messages are sent with +DAC7 ([ApplicationWithDac7.java](./bzst-dip-java-client-demo/src/main/java/software/xdev/ApplicationWithDac7.java)) or +the +CESOP ([ApplicationWithCesop.java](./bzst-dip-java-client-demo/src/main/java/software/xdev/ApplicationWithCesop.java)) +Format. + ## Support If you need support as soon as possible, and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support). diff --git a/bzst-dip-java-client-demo/pom.xml b/bzst-dip-java-client-demo/pom.xml index 734e5aff..12f7c7fb 100644 --- a/bzst-dip-java-client-demo/pom.xml +++ b/bzst-dip-java-client-demo/pom.xml @@ -49,7 +49,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.13.0 + 3.14.0 ${maven.compiler.release} diff --git a/bzst-dip-java-client/pom.xml b/bzst-dip-java-client/pom.xml index 2dbea192..e8f945a9 100644 --- a/bzst-dip-java-client/pom.xml +++ b/bzst-dip-java-client/pom.xml @@ -35,7 +35,7 @@ - Apache License, Version 2.0 + Apache-2.0 https://www.apache.org/licenses/LICENSE-2.0.txt repo @@ -49,7 +49,7 @@ UTF-8 0.12.6 - 2.18.2 + 2.19.0 src/generated/java @@ -57,7 +57,7 @@ src/generated/** - 5.11.4 + 5.12.2 @@ -76,7 +76,7 @@ commons-io commons-io - 2.18.0 + 2.19.0 jakarta.xml.bind @@ -129,7 +129,7 @@ org.apache.httpcomponents.client5 httpclient5 - 5.4.1 + 5.4.3 org.openapitools @@ -139,12 +139,12 @@ org.slf4j slf4j-api - 2.0.16 + 2.0.17 com.opencsv opencsv - 5.9 + 5.11 @@ -201,7 +201,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.8.0 + 3.9.0 @@ -209,7 +209,7 @@ com.mycila license-maven-plugin - 4.6 + 5.0.0 ${project.organization.url} @@ -238,7 +238,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.13.0 + 3.14.0 ${maven.compiler.release} @@ -306,7 +306,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.6.0 + 1.7.0 ossrh @@ -371,7 +371,7 @@ com.puppycrawl.tools checkstyle - 10.21.1 + 10.23.1 @@ -407,7 +407,7 @@ org.apache.maven.plugins maven-clean-plugin - 3.4.0 + 3.4.1 pre-generation-clean @@ -570,12 +570,12 @@ net.sourceforge.pmd pmd-core - 7.9.0 + 7.13.0 net.sourceforge.pmd pmd-java - 7.9.0 + 7.13.0 diff --git a/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/exception/TaxNumberException.java b/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/exception/TaxNumberException.java index 5100ea7b..048d5278 100644 --- a/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/exception/TaxNumberException.java +++ b/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/exception/TaxNumberException.java @@ -23,6 +23,6 @@ public class TaxNumberException extends ConfigurationException { public TaxNumberException(final String taxNumber) { - super("The taxnumber (Steueridentifikationsnummer) is not valid!"); + super("The taxnumber (Steueridentifikationsnummer) '" + taxNumber + "' is not valid!"); } } diff --git a/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/util/WebClientUtil.java b/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/util/WebClientUtil.java index ac4e4136..4442fad6 100644 --- a/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/util/WebClientUtil.java +++ b/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/util/WebClientUtil.java @@ -24,8 +24,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -41,7 +39,6 @@ */ public final class WebClientUtil { - private static final Logger LOGGER = LoggerFactory.getLogger(WebClientUtil.class); public static final String TAG_NAME_DATENTRANSFERNUMMER = "Datentransfernummer"; private WebClientUtil() diff --git a/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/webclient/WebClient.java b/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/webclient/WebClient.java index 8eb0f38b..e79217ec 100644 --- a/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/webclient/WebClient.java +++ b/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/webclient/WebClient.java @@ -141,8 +141,6 @@ public BzstDipSingleTransferResult requestTransferResult(final String dataTransf ) ) { - final String text = new String(inputStream.readAllBytes(), StandardCharsets.UTF_8); - // TODO: Check text return new BzstDipSingleTransferResult(dataTransferNumber, 2); diff --git a/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/ReportableSellerCreator.java b/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/ReportableSellerCreator.java index 2c89103a..ccec4e15 100644 --- a/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/ReportableSellerCreator.java +++ b/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/ReportableSellerCreator.java @@ -338,7 +338,7 @@ private static OrganisationPartyType createOrganisationPartyType( */ public static boolean isNULLAsString(final String checkNULLString) { - return checkNULLString.equals(NULL_STRING); + return NULL_STRING.equals(checkNULLString); } private static OrganisationINType createIN(final String in) diff --git a/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/XMLDocumentBodyCreator.java b/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/XMLDocumentBodyCreator.java index e8a01b27..e7a9ff03 100644 --- a/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/XMLDocumentBodyCreator.java +++ b/bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/XMLDocumentBodyCreator.java @@ -133,6 +133,7 @@ private Object createData( return dataType; } + @SuppressWarnings("PMD.UnusedFormalParameter") // TODO Needs to be resolved! private Object createData( final PaymentDataBodyType paymentDataBodyType) throws DatatypeConfigurationException { diff --git a/bzst-dip-java-client/src/test/java/software/xdev/bzst/dip/client/signing/SigningProviderByJksTest.java b/bzst-dip-java-client/src/test/java/software/xdev/bzst/dip/client/signing/SigningProviderByJksTest.java index 052ef9a3..b6fece38 100644 --- a/bzst-dip-java-client/src/test/java/software/xdev/bzst/dip/client/signing/SigningProviderByJksTest.java +++ b/bzst-dip-java-client/src/test/java/software/xdev/bzst/dip/client/signing/SigningProviderByJksTest.java @@ -56,7 +56,7 @@ void getPrivateKeyWrongPassword() ); Assertions.assertThrows( SigningException.class, - () -> signingProviderByJks.getPrivateKey() + signingProviderByJks::getPrivateKey ); } @@ -69,7 +69,7 @@ void getCertificateWrongPassword() ); Assertions.assertThrows( SigningException.class, - () -> signingProviderByJks.getCertificate() + signingProviderByJks::getCertificate ); } } diff --git a/pom.xml b/pom.xml index 582f2065..c76c878c 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ - Apache License, Version 2.0 + Apache-2.0 https://www.apache.org/licenses/LICENSE-2.0.txt repo @@ -45,7 +45,7 @@ com.puppycrawl.tools checkstyle - 10.21.1 + 10.23.1 @@ -82,12 +82,12 @@ net.sourceforge.pmd pmd-core - 7.9.0 + 7.13.0 net.sourceforge.pmd pmd-java - 7.9.0 + 7.13.0