From 66aa899cc2767dce2dc40ee30bff750ed9b10751 Mon Sep 17 00:00:00 2001 From: AB Date: Fri, 21 Apr 2023 11:35:19 +0200 Subject: [PATCH 01/95] Change template repo's name --- .github/workflows/update-from-template.yml | 2 +- SECURITY.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml index 60bad1d..7da8af8 100644 --- a/.github/workflows/update-from-template.yml +++ b/.github/workflows/update-from-template.yml @@ -14,7 +14,7 @@ on: env: UPDATE_BRANCH: update-from-template - REMOTE_URL: https://github.com/xdev-software/base-template.git + REMOTE_URL: https://github.com/xdev-software/standard-maven-template.git REMOTE_BRANCH: master permissions: diff --git a/SECURITY.md b/SECURITY.md index 36d6305..92188f3 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,4 +2,4 @@ ## Reporting a Vulnerability -Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/base-template/security/advisories/new). +Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/standard-maven-template/security/advisories/new). From 614bb1b0a485030511afe9673380744e392ba35b Mon Sep 17 00:00:00 2001 From: AB Date: Fri, 21 Apr 2023 12:25:08 +0200 Subject: [PATCH 02/95] Add common code --- .github/workflows/checkBuild.yml | 63 ++++++++ .github/workflows/release.yml | 231 +++++++++++++++++++++++++++ .github/workflows/sonar.yml | 57 +++++++ .github/workflows/test-deploy.yml | 32 ++++ .gitignore | 87 ++++++++++ .run/Run Demo.run.xml | 16 ++ CONTRIBUTING.md | 46 ++++++ LICENSE | 201 +++++++++++++++++++++++ README.md | 19 +++ pom.xml | 29 ++++ standard-maven-template-demo/pom.xml | 63 ++++++++ standard-maven-template/pom.xml | 208 ++++++++++++++++++++++++ 12 files changed, 1052 insertions(+) create mode 100644 .github/workflows/checkBuild.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/sonar.yml create mode 100644 .github/workflows/test-deploy.yml create mode 100644 .gitignore create mode 100644 .run/Run Demo.run.xml create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 pom.xml create mode 100644 standard-maven-template-demo/pom.xml create mode 100644 standard-maven-template/pom.xml diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml new file mode 100644 index 0000000..cd0bb79 --- /dev/null +++ b/.github/workflows/checkBuild.yml @@ -0,0 +1,63 @@ +name: Check Build + +on: + workflow_dispatch: + push: + branches: [ develop ] + paths-ignore: + - '**.md' + pull_request: + branches: [ develop ] + paths-ignore: + - '**.md' + +env: + PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} + DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + java: [17] + distribution: [temurin] + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + cache: 'maven' + + - name: Build with Maven + run: mvn -B clean package + + - name: Check for uncommited changes + run: | + if [[ "$(git status --porcelain)" != "" ]]; then + echo ---------------------------------------- + echo git status + echo ---------------------------------------- + git status + echo ---------------------------------------- + echo git diff + echo ---------------------------------------- + git diff + echo ---------------------------------------- + echo Troubleshooting + echo ---------------------------------------- + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package" + exit 1 + fi + + - name: Upload demo files + uses: actions/upload-artifact@v3 + with: + name: demo-files-java-${{ matrix.java }} + path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..609af70 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,231 @@ +name: Release + +on: + push: + branches: [ master ] + +env: + PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} + DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo + +permissions: + contents: write + pull-requests: write + +jobs: + check_code: # Validates the code + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + + - name: Build with Maven + run: mvn -B clean package + + - name: Check for uncommited changes + run: | + if [[ "$(git status --porcelain)" != "" ]]; then + echo ---------------------------------------- + echo git status + echo ---------------------------------------- + git status + echo ---------------------------------------- + echo git diff + echo ---------------------------------------- + git diff + echo ---------------------------------------- + echo Troubleshooting + echo ---------------------------------------- + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package" + exit 1 + fi + + prepare_release: + runs-on: ubuntu-latest + needs: [check_code] + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - uses: actions/checkout@v3 + + - name: Configure Git + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + + - name: Un-SNAP root + run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + + - name: Un-SNAP demo + run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + working-directory: ${{ env.DEMO_MAVEN_MODULE }} + + - name: Un-SNAP + run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + + - name: Get version + id: version + run: | + version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "release=$version" >> $GITHUB_OUTPUT + echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + + - name: Commit and Push + run: | + git add -A + git commit -m "Release ${{ steps.version.outputs.release }}" + git push origin + git tag v${{ steps.version.outputs.release }} + git push origin --tags + + - name: Create Release + id: create_release + uses: shogo82148/actions-create-release@v1 + with: + tag_name: v${{ steps.version.outputs.release }} + release_name: v${{ steps.version.outputs.release }} + commitish: master + body: | + ## [Changelog](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) + See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information. + + ## Installation + Add the following lines to your pom: + ```XML + + com.xdev-software + ${{ env.PRIMARY_MAVEN_MODULE }} + ${{ steps.version.outputs.release }} + + ``` + + publish_central: # Publish the code to central + runs-on: ubuntu-latest + needs: [prepare_release] + steps: + - uses: actions/checkout@v3 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Set up JDK Apache Maven Central + uses: actions/setup-java@v3 + with: # running setup-java again overwrites the settings.xml + java-version: '17' + distribution: 'temurin' + server-id: ossrh + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Publish to Apache Maven Central + run: mvn -B deploy -Possrh + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + + publish-pages: + name: Publish dependencies and licenses to github pages + runs-on: ubuntu-latest + needs: [prepare_release] + steps: + - uses: actions/checkout@v3 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Setup - Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + + - name: Build dependencies/licenses files + run: mvn -B project-info-reports:dependencies + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + + - name: Upload licenses - Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: dependencies-licenses + path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/site + + - name: Generate docs/dependencies dir + run: mkdir -p docs/dependencies + + - name: Move built files into docs/dependencies + run: mv ${{ env.PRIMARY_MAVEN_MODULE }}/target/site/* docs/dependencies + + - name: Rename dependencies.html to index.html + working-directory: docs/dependencies + run: mv dependencies.html index.html + + - name: Copy Readme into docs (as index.md) + run: cp README.md docs/index.md + + - name: Configure Pages + working-directory: docs + run: |- + echo "theme: jekyll-theme-tactile" > _config.yml + + - name: Deploy to Github pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs + enable_jekyll: true + + after_release: + runs-on: ubuntu-latest + needs: [publish_central] + steps: + - uses: actions/checkout@v3 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Inc Version and SNAP root + run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true + + - name: Inc Version and SNAP demo + run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true + working-directory: ${{ env.DEMO_MAVEN_MODULE }} + + - name: Inc Version and SNAP + run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + + - name: Git Commit and Push + run: | + git add -A + git commit -m "Preparing for next development iteration" + git push origin + + - name: pull-request + uses: repo-sync/pull-request@v2 + with: + destination_branch: "develop" + pr_title: "Sync back" + pr_body: "An automated PR to sync changes back" + diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 0000000..171b60d --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,57 @@ +name: Sonar + +on: + workflow_dispatch: + push: + branches: [ develop ] + paths-ignore: + - '**.md' + - 'assets/**' + - 'config/**' + pull_request: + types: [opened, synchronize, reopened] + paths-ignore: + - '**.md' + - 'assets/**' + - 'config/**' + +env: + SONARCLOUD_ORG: ${{ github.event.organization.login }} + SONARCLOUD_HOST: https://sonarcloud.io + +jobs: + sonar: + name: SonarCloud Scan + runs-on: ubuntu-latest + # Dependabot PRs have no access to secrets (SONAR_TOKEN) -> Ignore them + if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'dependabot/') }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 17 + + - name: Cache SonarCloud packages + uses: actions/cache@v3 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Cache Maven packages + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Build with Maven + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=${{ env.SONARCLOUD_ORG }}_${{ github.event.repository.name }} -Dsonar.organization=${{ env.SONARCLOUD_ORG }} -Dsonar.host.url=${{ env.SONARCLOUD_HOST }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 0000000..3e44f39 --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,32 @@ +name: Test Deployment + +on: + workflow_dispatch: + +env: + PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} + +jobs: + publish_central: # Publish the code to central + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK OSSRH + uses: actions/setup-java@v3 + with: # running setup-java again overwrites the settings.xml + distribution: 'temurin' + java-version: '17' + server-id: ossrh + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Publish to OSSRH + run: mvn -B deploy -Possrh + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d0e81bf --- /dev/null +++ b/.gitignore @@ -0,0 +1,87 @@ +# Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package/Binary Files don't belong into a git repo +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar +*.dll +*.exe +*.bin + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + + +# bin / compiled stuff +target/ + + +# JRebel +**/resources/rebel.xml +**/resources/rebel-remote.xml + +# eclispe stuff for root +/.settings/ +/.classpath +/.project + + +# eclispe stuff for modules +/*/.metadata/ +/*/.apt_generated_tests/ +/*/.settings/ +/*/.classpath +/*/.project +/*/RemoteSystemsTempFiles/ + +#custom +.flattened-pom.xml +.tern-project + +# == IntelliJ == +*.iml +*.ipr + +# Some files are user/installation independent and are used for configuring the IDE +# See also https://stackoverflow.com/a/35279076 + +.idea/* +!.idea/saveactions_settings.xml +!.idea/checkstyle-idea.xml + +!.idea/inspectionProfiles/ +.idea/inspectionProfiles/* +!.idea/inspectionProfiles/Project_Default.xml + +!.idea/codeStyles/ +.idea/codeStyles/* +!.idea/codeStyles/codeStyleConfig.xml +!.idea/codeStyles/Project.xml diff --git a/.run/Run Demo.run.xml b/.run/Run Demo.run.xml new file mode 100644 index 0000000..764b3b9 --- /dev/null +++ b/.run/Run Demo.run.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..79c7cf2 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,46 @@ +## Contributing + +We would absolutely love to get the community involved, and we welcome any form of contributions – comments and questions on different communication channels, issues and pull request in the repositories, and anything that you build and share using our components. + +### Get in touch with the team + +Twitter: https://twitter.com/xdevsoftware +
+Mail: opensource@xdev-software.de + +### Some ways to help: + +- **Report bugs**: File issues on GitHub. +- **Send pull requests**: If you want to contribute code, check out the development instructions below. + +We encourage you to read the [contribution instructions by GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing) also. + +## Developing + +### Software Requirements +You should have the following things installed: +* Git +* Java 17 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/)) +* Maven + +### Recommended setup +* Install ``IntelliJ`` (Community Edition is sufficient) + * Install the following plugins: + * [Save Actions](https://plugins.jetbrains.com/plugin/7642-save-actions) - Provides save actions, like running the formatter or adding ``final`` to fields + * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis + * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis + * Import the project + * Ensure that everything is encoded in ``UTF-8`` + * Ensure that the JDK/Java-Version is correct + + +## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/standard-maven-template/release.yml?branch=master)](https://github.com/xdev-software/standard-maven-template/actions/workflows/release.yml) + +Before releasing: +* Consider doing a [test-deployment](https://github.com/xdev-software/standard-maven-template/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing. +* Check the [changelog](CHANGELOG.md) + +If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes + +When the release is finished do the following: +* Merge the auto-generated PR (with the incremented version number) back into the ``develop`` diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9c4a4b1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 XDEV Software + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c4d0890 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +[![Latest version](https://img.shields.io/maven-central/v/com.xdev-software/standard-maven-template)](https://mvnrepository.com/artifact/com.xdev-software/standard-maven-template) +[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/standard-maven-template/checkBuild.yml?branch=develop)](https://github.com/xdev-software/standard-maven-template/actions/workflows/checkBuild.yml?query=branch%3Adevelop) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_standard-maven-template&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_standard-maven-template) + +# standard-maven-template + + +## Installation +[Installation guide for the latest release](https://github.com/xdev-software/standard-maven-template/releases/latest#Installation) + + +## 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). + +## Contributing +See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project. + +## Dependencies and Licenses +View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/standard-maven-template/dependencies/) diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..ada9282 --- /dev/null +++ b/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + com.xdev-software + standard-maven-template-root + 1.0.0-SNAPSHOT + pom + + + XDEV Software + https://xdev.software + + + + standard-maven-template + standard-maven-template-demo + + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml new file mode 100644 index 0000000..10d5305 --- /dev/null +++ b/standard-maven-template-demo/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + com.xdev-software + standard-maven-template-demo + 1.0.0-SNAPSHOT + jar + + 2022 + + + XDEV Software + https://xdev.software + + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + apache_v2 + + 17 + ${javaVersion} + + UTF-8 + UTF-8 + + software.xdev.Application + + + + + com.xdev-software + standard-maven-template + ${project.version} + + + + + ${project.artifactId} + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + ${maven.compiler.release} + + -proc:none + + + + + + diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml new file mode 100644 index 0000000..34593b7 --- /dev/null +++ b/standard-maven-template/pom.xml @@ -0,0 +1,208 @@ + + + 4.0.0 + + com.xdev-software + standard-maven-template + 1.0.0-SNAPSHOT + jar + + standard-maven-template + standard-maven-template + https://github.com/xdev-software/standard-maven-template + + + https://github.com/xdev-software/standard-maven-template + https://github.com/xdev-software/standard-maven-template.git + + + 2023 + + + XDEV Software + https://xdev.software + + + + + XDEV Software + XDEV Software + https://xdev.software + + + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + 17 + ${javaVersion} + + UTF-8 + UTF-8 + + + + + + central + https://repo.maven.apache.org/maven2 + + false + + + + + + + + central + https://repo.maven.apache.org/maven2 + + false + + + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + + com.mycila + license-maven-plugin + 4.2 + + + ${project.organization.url} + + + +
com/mycila/maven/plugin/license/templates/APACHE-2.txt
+ + src/main/java/** + src/test/java/** + +
+
+
+ + + first + + format + + process-sources + + +
+ + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + ${maven.compiler.release} + + -proc:none + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + + attach-javadocs + verify + + jar + + + + + true + none + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + verify + + jar-no-fork + + + + +
+
+ + + ossrh + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + --pinentry-mode + loopback + + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://oss.sonatype.org/ + + 30 + true + + + + + + +
From d10a6c9efedf974945adbf2fd3782375b3c585fe Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Fri, 5 May 2023 14:37:08 +0200 Subject: [PATCH 03/95] Update README.md Add logo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c4d0890..e288929 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Latest version](https://img.shields.io/maven-central/v/com.xdev-software/standard-maven-template)](https://mvnrepository.com/artifact/com.xdev-software/standard-maven-template) +[![Latest version](https://img.shields.io/maven-central/v/com.xdev-software/standard-maven-template?logo=apache%20maven)](https://mvnrepository.com/artifact/com.xdev-software/standard-maven-template) [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/standard-maven-template/checkBuild.yml?branch=develop)](https://github.com/xdev-software/standard-maven-template/actions/workflows/checkBuild.yml?query=branch%3Adevelop) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_standard-maven-template&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_standard-maven-template) From 7205b466e3e8980c140720230cc7bad8dfc24128 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Fri, 5 May 2023 14:51:57 +0200 Subject: [PATCH 04/95] Update LICENSE Update to current year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 9c4a4b1..2316c75 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2020 XDEV Software + Copyright 2023 XDEV Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 0889e16bc8d3c7bceb84fe771c0ac31eda4f977b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 01:18:58 +0000 Subject: [PATCH 05/95] Bump maven-gpg-plugin from 3.0.1 to 3.1.0 Bumps [maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.0.1 to 3.1.0. - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.0.1...maven-gpg-plugin-3.1.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 34593b7..6fb0a3b 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -168,7 +168,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts From f4da54701159bdcac1659ee864a0af0f3d5386b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 01:45:09 +0000 Subject: [PATCH 06/95] Bump maven-source-plugin from 3.2.1 to 3.3.0 Bumps [maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.2.1 to 3.3.0. - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.2.1...maven-source-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-source-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 6fb0a3b..9f74dbf 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -147,7 +147,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.0 attach-sources From 1c37f6da5f2fd2deeced3fdc8f34a5e54f6781f4 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 6 Jun 2023 09:37:58 +0200 Subject: [PATCH 07/95] Removed unused property --- standard-maven-template-demo/pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index 10d5305..a441c85 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -24,8 +24,6 @@ - apache_v2 - 17 ${javaVersion} From e07b6c1c67fdcbeb62554dd6af1c39b5e34bde6b Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 6 Jun 2023 09:40:03 +0200 Subject: [PATCH 08/95] Removed license from demo * Demo is never distributed via Maven * Demo license is always the same as the parent license --- standard-maven-template-demo/pom.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index a441c85..f2df5ec 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -16,13 +16,6 @@ https://xdev.software - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - - - 17 ${javaVersion} From 3fb9d4b33f0c6cfa35071d6d5fadaa008b761416 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 6 Jun 2023 14:08:23 +0200 Subject: [PATCH 09/95] Build executable jar in demo --- standard-maven-template-demo/pom.xml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index f2df5ec..018a999 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -49,6 +49,34 @@ + + org.apache.maven.plugins + maven-assembly-plugin + 3.6.0 + + + + ${mainClass} + + + true + + + + jar-with-dependencies + + false + + + + make-assembly + package + + single + + + + From ca645bc46cf16473696805e380eca88de1be9745 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 26 Jun 2023 10:01:21 +0200 Subject: [PATCH 10/95] Replace deprecated save actions plugin with XDEV fork --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 79c7cf2..ba0aff1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,7 @@ You should have the following things installed: ### Recommended setup * Install ``IntelliJ`` (Community Edition is sufficient) * Install the following plugins: - * [Save Actions](https://plugins.jetbrains.com/plugin/7642-save-actions) - Provides save actions, like running the formatter or adding ``final`` to fields + * [Save Actions](https://plugins.jetbrains.com/plugin/22113) - Provides save actions, like running the formatter or adding ``final`` to fields * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis * Import the project From f8e672881b2a8ef972a2064e412df9e1b8c3e17c Mon Sep 17 00:00:00 2001 From: AB Date: Fri, 7 Jul 2023 12:18:51 +0200 Subject: [PATCH 11/95] Rework Contributing.md --- CONTRIBUTING.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba0aff1..8468781 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,19 +1,18 @@ ## Contributing -We would absolutely love to get the community involved, and we welcome any form of contributions – comments and questions on different communication channels, issues and pull request in the repositories, and anything that you build and share using our components. +We would absolutely love to get the community involved, and we welcome any form of contributions – comments and questions on different communication channels, issues and pull request and anything that you build and share using our components. -### Get in touch with the team +### Communication channels +* Communication is primarily done using issues. +* 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). +* As a last resort measure or on otherwise important matter you may also [contact us directly](https://xdev.software/en/about-us/contact). -Twitter: https://twitter.com/xdevsoftware -
-Mail: opensource@xdev-software.de +### Ways to help +* **Report bugs**
Create an issue or send a pull request +* **Send pull requests**
If you want to contribute code, check out the development instructions below. + * However when contributing new features, please first discuss the change you wish to make via issue with the owners of this repository before making a change. Otherwise your work might be rejected and your effort was pointless. -### Some ways to help: - -- **Report bugs**: File issues on GitHub. -- **Send pull requests**: If you want to contribute code, check out the development instructions below. - -We encourage you to read the [contribution instructions by GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing) also. +We also encourage you to read the [contribution instructions by GitHub](https://docs.github.com/en/get-started/quickstart/contributing-to-projects). ## Developing From 7c38b04b5b1ad50dd4e930d9679e67e4d8aa4f38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Sep 2023 07:30:12 +0000 Subject: [PATCH 12/95] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/checkBuild.yml | 2 +- .github/workflows/release.yml | 10 +++++----- .github/workflows/sonar.yml | 2 +- .github/workflows/test-deploy.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index cd0bb79..c23ac42 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -25,7 +25,7 @@ jobs: distribution: [temurin] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 609af70..53d1c12 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: check_code: # Validates the code runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v3 @@ -52,7 +52,7 @@ jobs: outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Configure Git run: | @@ -111,7 +111,7 @@ jobs: runs-on: ubuntu-latest needs: [prepare_release] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Init Git and pull run: | @@ -143,7 +143,7 @@ jobs: runs-on: ubuntu-latest needs: [prepare_release] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Init Git and pull run: | @@ -197,7 +197,7 @@ jobs: runs-on: ubuntu-latest needs: [publish_central] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Init Git and pull run: | diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 171b60d..f7c82af 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -26,7 +26,7 @@ jobs: # Dependabot PRs have no access to secrets (SONAR_TOKEN) -> Ignore them if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'dependabot/') }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 3e44f39..d2a8e2f 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -10,7 +10,7 @@ jobs: publish_central: # Publish the code to central runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK OSSRH uses: actions/setup-java@v3 From 48f0a23f572b8212cd604f9b85f3adf33a1d8ef5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 00:35:52 +0000 Subject: [PATCH 13/95] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.5.0 to 3.6.0 Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.5.0 to 3.6.0. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.5.0...maven-javadoc-plugin-3.6.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 9f74dbf..9176612 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -129,7 +129,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.0 attach-javadocs From c2ca04b205c0bb380fa66d19565da6e4b7da88de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 01:06:57 +0000 Subject: [PATCH 14/95] Bump com.mycila:license-maven-plugin from 4.2 to 4.3 Bumps com.mycila:license-maven-plugin from 4.2 to 4.3. --- updated-dependencies: - dependency-name: com.mycila:license-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 9f74dbf..349bfc7 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -89,7 +89,7 @@ com.mycila license-maven-plugin - 4.2 + 4.3 ${project.organization.url} From cfc09139877497ff163fd490910467131c614a1b Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 2 Oct 2023 12:55:20 +0200 Subject: [PATCH 15/95] Replace outdated repo-sync/pull-request --- .github/workflows/release.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 53d1c12..b2ae4d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -223,9 +223,12 @@ jobs: git push origin - name: pull-request - uses: repo-sync/pull-request@v2 - with: - destination_branch: "develop" - pr_title: "Sync back" - pr_body: "An automated PR to sync changes back" - + env: + GH_TOKEN: ${{ github.token }} + run: | + gh_pr_up() { + gh pr create "$@" || gh pr edit "$@" + } + gh_pr_up -B "develop" \ + --title "Sync back" \ + --body "An automated PR to sync changes back" From 6c3628b57cbc523a5128b54d8cd207912410d363 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 26 Oct 2023 16:18:21 +0200 Subject: [PATCH 16/95] Compile with Java 21 --- .github/workflows/checkBuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index c23ac42..2e93229 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: - java: [17] + java: [17, 21] distribution: [temurin] steps: From 36b201e9c37a935cc1d209d8427b847a6f81da1f Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 26 Oct 2023 16:18:36 +0200 Subject: [PATCH 17/95] Recommend Java 21 for development --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8468781..2f8dd90 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ We also encourage you to read the [contribution instructions by GitHub](https:// ### Software Requirements You should have the following things installed: * Git -* Java 17 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/)) +* Java 21 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/)) * Maven ### Recommended setup From 77bcbb30915b41cb0597d05c960ac185c9a2c8b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 00:54:24 +0000 Subject: [PATCH 18/95] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.0 to 3.6.2 Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.0 to 3.6.2. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.0...maven-javadoc-plugin-3.6.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 4cf308c..7884169 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -129,7 +129,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.0 + 3.6.2 attach-javadocs From e458faaeec9cb3285a9a40e9311fc02fb8f7590a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 00:50:59 +0000 Subject: [PATCH 19/95] Bump actions/setup-java from 3 to 4 Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-java dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/checkBuild.yml | 2 +- .github/workflows/release.yml | 6 +++--- .github/workflows/sonar.yml | 2 +- .github/workflows/test-deploy.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 2e93229..8d2a0bb 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2ae4d2..b370373 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' @@ -120,7 +120,7 @@ jobs: git pull - name: Set up JDK Apache Maven Central - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: # running setup-java again overwrites the settings.xml java-version: '17' distribution: 'temurin' @@ -152,7 +152,7 @@ jobs: git pull - name: Setup - Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index f7c82af..7c3e344 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -31,7 +31,7 @@ jobs: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Set up JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: 17 diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index d2a8e2f..0bf5779 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up JDK OSSRH - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: # running setup-java again overwrites the settings.xml distribution: 'temurin' java-version: '17' From 4efe636afe4cea99efc0bd8fa196326c2f0a093c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 00:42:14 +0000 Subject: [PATCH 20/95] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.2 to 3.6.3 Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.2 to 3.6.3. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.2...maven-javadoc-plugin-3.6.3) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 7884169..1c8d796 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -129,7 +129,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.2 + 3.6.3 attach-javadocs From 4cd258eadde8f86f32e03e96466d3adc2b46bda8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 00:09:07 +0000 Subject: [PATCH 21/95] Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/checkBuild.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 8d2a0bb..cf1783a 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -56,7 +56,7 @@ jobs: fi - name: Upload demo files - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: demo-files-java-${{ matrix.java }} path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b370373..67e08a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -163,7 +163,7 @@ jobs: working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Upload licenses - Upload Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: dependencies-licenses path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/site From d200d7ecb3d452bd52db43271b5988112964f27d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 00:49:03 +0000 Subject: [PATCH 22/95] Bump org.apache.maven.plugins:maven-compiler-plugin Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.11.0 to 3.12.1. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.11.0...maven-compiler-plugin-3.12.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- standard-maven-template-demo/pom.xml | 2 +- standard-maven-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index 018a999..420499a 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -41,7 +41,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.12.1 ${maven.compiler.release} diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 1c8d796..be62129 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -118,7 +118,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.12.1 ${maven.compiler.release} From 09d20ce213c2948b3c95671f2246458ad265225e Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 11 Jan 2024 15:38:37 +0100 Subject: [PATCH 23/95] Checkstyle + Maven --- pom.xml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pom.xml b/pom.xml index ada9282..e3f6ed1 100644 --- a/pom.xml +++ b/pom.xml @@ -26,4 +26,36 @@ repo + + + + checkstyle + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.3.1 + + + com.puppycrawl.tools + checkstyle + 10.12.7 + + + + .config/checkstyle/checkstyle.xml + + + + + check + + + + + + + + From ff92e4a6ac31dfa48bc2eccd625da0732ad409d2 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 11 Jan 2024 15:40:46 +0100 Subject: [PATCH 24/95] Run Checkstyle in workflow --- .github/workflows/checkBuild.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index cf1783a..9b50dad 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -61,3 +61,24 @@ jobs: name: demo-files-java-${{ matrix.java }} path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar if-no-files-found: error + + code-style: + runs-on: ubuntu-latest + + strategy: + matrix: + java: [17] + distribution: [temurin] + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + cache: 'maven' + + - name: Run Checkstyle + run: mvn -B checkstyle:check -P checkstyle -T2C From 39be7170d94de7c655da8cca0caf5701aad419ec Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 11 Jan 2024 15:41:13 +0100 Subject: [PATCH 25/95] Adjust ignored workflow paths --- .github/workflows/checkBuild.yml | 6 ++++++ .github/workflows/sonar.yml | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 9b50dad..c7b324d 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -6,10 +6,16 @@ on: branches: [ develop ] paths-ignore: - '**.md' + - '.config/**' + - '.idea/**' + - 'assets/**' pull_request: branches: [ develop ] paths-ignore: - '**.md' + - '.config/**' + - '.idea/**' + - 'assets/**' env: PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 7c3e344..7600223 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -6,14 +6,16 @@ on: branches: [ develop ] paths-ignore: - '**.md' + - '.config/**' + - '.idea/**' - 'assets/**' - - 'config/**' pull_request: types: [opened, synchronize, reopened] paths-ignore: - '**.md' + - '.config/**' + - '.idea/**' - 'assets/**' - - 'config/**' env: SONARCLOUD_ORG: ${{ github.event.organization.login }} From eabda82c489e4d6d985b50f4c7fdf065d7b99691 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 11 Jan 2024 16:15:57 +0100 Subject: [PATCH 26/95] Fix maven checkstyle As root module is just there to track the independent child modules, they don't get the plugin's configuration --- pom.xml | 18 ++-------------- standard-maven-template-demo/pom.xml | 31 ++++++++++++++++++++++++++++ standard-maven-template/pom.xml | 29 ++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index e3f6ed1..aeeadbc 100644 --- a/pom.xml +++ b/pom.xml @@ -29,30 +29,16 @@ + checkstyle org.apache.maven.plugins maven-checkstyle-plugin - 3.3.1 - - - com.puppycrawl.tools - checkstyle - 10.12.7 - - - .config/checkstyle/checkstyle.xml + true - - - - check - - - diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index 420499a..d006d08 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -79,4 +79,35 @@ + + + checkstyle + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.3.1 + + + com.puppycrawl.tools + checkstyle + 10.12.7 + + + + ../.config/checkstyle/checkstyle.xml + + + + + check + + + + + + + + diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index be62129..2efde83 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -204,5 +204,34 @@ + + checkstyle + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.3.1 + + + com.puppycrawl.tools + checkstyle + 10.12.7 + + + + ../.config/checkstyle/checkstyle.xml + + + + + check + + + + + + + From c10c778467d19c30a8d246bef43bf8e507c34728 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 11 Jan 2024 16:23:29 +0100 Subject: [PATCH 27/95] Fix maven warning --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index aeeadbc..966e945 100644 --- a/pom.xml +++ b/pom.xml @@ -36,6 +36,7 @@ org.apache.maven.plugins maven-checkstyle-plugin + 3.3.1 true From 6fdcf4683a7eed094918cbd97565e130e3cb82c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 01:01:08 +0000 Subject: [PATCH 28/95] Bump actions/cache from 3 to 4 Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sonar.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 7600223..a255e87 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -39,14 +39,14 @@ jobs: java-version: 17 - name: Cache SonarCloud packages - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Cache Maven packages - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} From 85dfdc94c644594838aab1bc51e66f2df5d2224e Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 18 Jan 2024 13:03:35 +0100 Subject: [PATCH 29/95] ``com.xdev-software`` -> ``software.xdev`` https://github.com/xdev-software/github/issues/5 --- .github/workflows/release.yml | 6 +++--- .github/workflows/test-deploy.yml | 4 ++-- README.md | 2 +- pom.xml | 2 +- standard-maven-template-demo/pom.xml | 4 ++-- standard-maven-template/pom.xml | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67e08a5..e03a52d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -101,7 +101,7 @@ jobs: Add the following lines to your pom: ```XML - com.xdev-software + software.xdev ${{ env.PRIMARY_MAVEN_MODULE }} ${{ steps.version.outputs.release }} @@ -133,8 +133,8 @@ jobs: - name: Publish to Apache Maven Central run: mvn -B deploy -Possrh env: - MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 0bf5779..4e883f8 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -27,6 +27,6 @@ jobs: run: mvn -B deploy -Possrh working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} env: - MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/README.md b/README.md index e288929..b90c3eb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Latest version](https://img.shields.io/maven-central/v/com.xdev-software/standard-maven-template?logo=apache%20maven)](https://mvnrepository.com/artifact/com.xdev-software/standard-maven-template) +[![Latest version](https://img.shields.io/maven-central/v/software.xdev/standard-maven-template?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/standard-maven-template) [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/standard-maven-template/checkBuild.yml?branch=develop)](https://github.com/xdev-software/standard-maven-template/actions/workflows/checkBuild.yml?query=branch%3Adevelop) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_standard-maven-template&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_standard-maven-template) diff --git a/pom.xml b/pom.xml index 966e945..4e48f7a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.xdev-software + software.xdev standard-maven-template-root 1.0.0-SNAPSHOT pom diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index d006d08..c612333 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.xdev-software + software.xdev standard-maven-template-demo 1.0.0-SNAPSHOT jar @@ -28,7 +28,7 @@ - com.xdev-software + software.xdev standard-maven-template ${project.version} diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 2efde83..3f871ce 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.xdev-software + software.xdev standard-maven-template 1.0.0-SNAPSHOT jar From 4cfb4dcfa28c88ae4b62b182df8acc0fde1015b1 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 18 Jan 2024 13:33:46 +0100 Subject: [PATCH 30/95] Use new sonatype server https://github.com/xdev-software/github/issues/5 --- standard-maven-template/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 3f871ce..6b14131 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -76,11 +76,11 @@ ossrh - https://oss.sonatype.org/content/repositories/snapshots + https://s01.oss.sonatype.org/content/repositories/snapshots ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ @@ -195,7 +195,7 @@ true ossrh - https://oss.sonatype.org/ + https://s01.oss.sonatype.org/ 30 true From 29aadc08598758d5037d3bf4206c6c72d196c9d2 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 23 Jan 2024 12:42:48 +0100 Subject: [PATCH 31/95] Update release.yml Get all modules https://github.com/xdev-software/standard-maven-template/issues/20 --- .github/workflows/release.yml | 37 ++++++++++++++++------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e03a52d..3eb5408 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,6 @@ on: env: PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} - DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo permissions: contents: write @@ -58,17 +57,16 @@ jobs: run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - - - name: Un-SNAP root - run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false - - - name: Un-SNAP demo - run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false - working-directory: ${{ env.DEMO_MAVEN_MODULE }} - name: Un-SNAP - run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + run: | + modules=("") # root + modules+=($(grep -oP '(?<=module>)[^<]+' 'pom.xml')) + for i in "${modules[@]}" + do + echo "Processing $i/pom.xml" + (cd "$i" && mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false) + done - name: Get version id: version @@ -204,17 +202,16 @@ jobs: git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" git pull - - - name: Inc Version and SNAP root - run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true - - - name: Inc Version and SNAP demo - run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true - working-directory: ${{ env.DEMO_MAVEN_MODULE }} - + - name: Inc Version and SNAP - run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + run: | + modules=("") # root + modules+=($(grep -oP '(?<=module>)[^<]+' 'pom.xml')) + for i in "${modules[@]}" + do + echo "Processing $i/pom.xml" + (cd "$i" && mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true) + done - name: Git Commit and Push run: | From 3bb4346aa9740fa9f30a11a3f24bc61336ec16fc Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 23 Jan 2024 12:45:15 +0100 Subject: [PATCH 32/95] Ignore multi lines + fix ``warning: command substitution: ignored null byte in input`` --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3eb5408..534759b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,7 +61,7 @@ jobs: - name: Un-SNAP run: | modules=("") # root - modules+=($(grep -oP '(?<=module>)[^<]+' 'pom.xml')) + modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0')) for i in "${modules[@]}" do echo "Processing $i/pom.xml" @@ -206,7 +206,7 @@ jobs: - name: Inc Version and SNAP run: | modules=("") # root - modules+=($(grep -oP '(?<=module>)[^<]+' 'pom.xml')) + modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0')) for i in "${modules[@]}" do echo "Processing $i/pom.xml" From b9e9dae3debc69fb45c6c0228f04f005a550f2ab Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:11:59 +0100 Subject: [PATCH 33/95] Sonar: Skip tests --- .github/workflows/sonar.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index a255e87..bd37fc9 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -53,7 +53,12 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Build with Maven - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=${{ env.SONARCLOUD_ORG }}_${{ github.event.repository.name }} -Dsonar.organization=${{ env.SONARCLOUD_ORG }} -Dsonar.host.url=${{ env.SONARCLOUD_HOST }} + run: | + mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + -DskipTests \ + -Dsonar.projectKey=${{ env.SONARCLOUD_ORG }}_${{ github.event.repository.name }} \ + -Dsonar.organization=${{ env.SONARCLOUD_ORG }} \ + -Dsonar.host.url=${{ env.SONARCLOUD_HOST }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 530a5439db2a0c58e58c4cf31ac0cef8e72da876 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 01:16:47 +0000 Subject: [PATCH 34/95] Bump com.puppycrawl.tools:checkstyle from 10.12.7 to 10.13.0 Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 10.12.7 to 10.13.0. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-10.12.7...checkstyle-10.13.0) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- standard-maven-template-demo/pom.xml | 2 +- standard-maven-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index c612333..920d15d 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -92,7 +92,7 @@ com.puppycrawl.tools checkstyle - 10.12.7 + 10.13.0 diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 6b14131..c19cdce 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -216,7 +216,7 @@ com.puppycrawl.tools checkstyle - 10.12.7 + 10.13.0 From d80e7afb673b66781da1ea16ac22001245a23829 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:51:08 +0100 Subject: [PATCH 35/95] Update LICENSE to ``2024`` --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 2316c75..864bb41 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2023 XDEV Software + Copyright 2024 XDEV Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 406bfa0dcf5742b3ad237b568b0604b251670c11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 00:43:48 +0000 Subject: [PATCH 36/95] Bump com.puppycrawl.tools:checkstyle from 10.13.0 to 10.14.0 Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 10.13.0 to 10.14.0. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-10.13.0...checkstyle-10.14.0) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- standard-maven-template-demo/pom.xml | 2 +- standard-maven-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index 920d15d..2b80c69 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -92,7 +92,7 @@ com.puppycrawl.tools checkstyle - 10.13.0 + 10.14.0 diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index c19cdce..b8a7cc2 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -216,7 +216,7 @@ com.puppycrawl.tools checkstyle - 10.13.0 + 10.14.0 From ff1bbdf68fecb28fc7454658e0b2e0972b720a3a Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Fri, 1 Mar 2024 10:20:36 +0100 Subject: [PATCH 37/95] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index c7b324d..da4fbd4 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -7,6 +7,7 @@ on: paths-ignore: - '**.md' - '.config/**' + - '.github/**' - '.idea/**' - 'assets/**' pull_request: @@ -14,6 +15,7 @@ on: paths-ignore: - '**.md' - '.config/**' + - '.github/**' - '.idea/**' - 'assets/**' From 49b63d329416bd584a2efd0b13a5fb78f94d9965 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Fri, 1 Mar 2024 10:20:45 +0100 Subject: [PATCH 38/95] Update sonar.yml --- .github/workflows/sonar.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index bd37fc9..39335e0 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -7,6 +7,7 @@ on: paths-ignore: - '**.md' - '.config/**' + - '.github/**' - '.idea/**' - 'assets/**' pull_request: @@ -14,6 +15,7 @@ on: paths-ignore: - '**.md' - '.config/**' + - '.github/**' - '.idea/**' - 'assets/**' From c095b80f9ef38416871add8d9ce0d3756f97aaf4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 01:21:13 +0000 Subject: [PATCH 39/95] Bump org.apache.maven.plugins:maven-assembly-plugin from 3.6.0 to 3.7.0 Bumps [org.apache.maven.plugins:maven-assembly-plugin](https://github.com/apache/maven-assembly-plugin) from 3.6.0 to 3.7.0. - [Commits](https://github.com/apache/maven-assembly-plugin/compare/maven-assembly-plugin-3.6.0...maven-assembly-plugin-3.7.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-assembly-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- standard-maven-template-demo/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index 2b80c69..6a7ffcb 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -52,7 +52,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.6.0 + 3.7.0 From 822b62cbbae7bdf65b4bb7b3c40c58a036e87f4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 00:36:26 +0000 Subject: [PATCH 40/95] Bump com.puppycrawl.tools:checkstyle from 10.14.0 to 10.14.1 Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 10.14.0 to 10.14.1. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-10.14.0...checkstyle-10.14.1) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- standard-maven-template-demo/pom.xml | 2 +- standard-maven-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index 2b80c69..9621682 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -92,7 +92,7 @@ com.puppycrawl.tools checkstyle - 10.14.0 + 10.14.1 diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index b8a7cc2..c043d0d 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -216,7 +216,7 @@ com.puppycrawl.tools checkstyle - 10.14.0 + 10.14.1 From 765ada2af6bda80843e2541426134d7b65d342c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 00:36:30 +0000 Subject: [PATCH 41/95] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.1.0 to 3.2.0 Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.1.0 to 3.2.0. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.1.0...maven-gpg-plugin-3.2.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index b8a7cc2..aea39f7 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -168,7 +168,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.1.0 + 3.2.0 sign-artifacts From fa54897bad74da04c4e6cc6952d9df4a545cf509 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 14 Mar 2024 16:16:03 +0100 Subject: [PATCH 42/95] Add and use maven wrapper --- .github/workflows/checkBuild.yml | 6 +- .github/workflows/release.yml | 12 +- .github/workflows/sonar.yml | 2 +- .github/workflows/test-deploy.yml | 2 +- .mvn/wrapper/maven-wrapper.properties | 18 ++ CONTRIBUTING.md | 2 +- mvnw | 308 ++++++++++++++++++++++++++ mvnw.cmd | 205 +++++++++++++++++ 8 files changed, 543 insertions(+), 12 deletions(-) create mode 100644 .mvn/wrapper/maven-wrapper.properties create mode 100644 mvnw create mode 100644 mvnw.cmd diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index da4fbd4..d3993c2 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -43,7 +43,7 @@ jobs: cache: 'maven' - name: Build with Maven - run: mvn -B clean package + run: ./mvnw -B clean package - name: Check for uncommited changes run: | @@ -59,7 +59,7 @@ jobs: echo ---------------------------------------- echo Troubleshooting echo ---------------------------------------- - echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package" + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package" exit 1 fi @@ -89,4 +89,4 @@ jobs: cache: 'maven' - name: Run Checkstyle - run: mvn -B checkstyle:check -P checkstyle -T2C + run: ./mvnw -B checkstyle:check -P checkstyle -T2C diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 534759b..a7e212a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: cache: 'maven' - name: Build with Maven - run: mvn -B clean package + run: ./mvnw -B clean package - name: Check for uncommited changes run: | @@ -41,7 +41,7 @@ jobs: echo ---------------------------------------- echo Troubleshooting echo ---------------------------------------- - echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package" + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package" exit 1 fi @@ -65,13 +65,13 @@ jobs: for i in "${modules[@]}" do echo "Processing $i/pom.xml" - (cd "$i" && mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false) + (cd "$i" && ../mvnw -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false) done - name: Get version id: version run: | - version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + version=$(../mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) echo "release=$version" >> $GITHUB_OUTPUT echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} @@ -129,7 +129,7 @@ jobs: gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - name: Publish to Apache Maven Central - run: mvn -B deploy -Possrh + run: ../mvnw -B deploy -Possrh env: MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} @@ -210,7 +210,7 @@ jobs: for i in "${modules[@]}" do echo "Processing $i/pom.xml" - (cd "$i" && mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true) + (cd "$i" && ../mvnw -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true) done - name: Git Commit and Push diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 39335e0..db10f67 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -56,7 +56,7 @@ jobs: - name: Build with Maven run: | - mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + ./mvnw -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ -DskipTests \ -Dsonar.projectKey=${{ env.SONARCLOUD_ORG }}_${{ github.event.repository.name }} \ -Dsonar.organization=${{ env.SONARCLOUD_ORG }} \ diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 4e883f8..cdd96cc 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -24,7 +24,7 @@ jobs: gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - name: Publish to OSSRH - run: mvn -B deploy -Possrh + run: ../mvnw -B deploy -Possrh working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} env: MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..eacdc9e --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2f8dd90..cbb31c6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,7 @@ We also encourage you to read the [contribution instructions by GitHub](https:// You should have the following things installed: * Git * Java 21 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/)) -* Maven +* Maven (Note that the [Maven Wrapper](https://maven.apache.org/wrapper/) is shipped with the repo) ### Recommended setup * Install ``IntelliJ`` (Community Edition is sufficient) diff --git a/mvnw b/mvnw new file mode 100644 index 0000000..8d937f4 --- /dev/null +++ b/mvnw @@ -0,0 +1,308 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.2.0 +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "$(uname)" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=$(java-config --jre-home) + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --unix "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --unix "$CLASSPATH") +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && + JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="$(which javac)" + if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=$(which readlink) + if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then + if $darwin ; then + javaHome="$(dirname "\"$javaExecutable\"")" + javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" + else + javaExecutable="$(readlink -f "\"$javaExecutable\"")" + fi + javaHome="$(dirname "\"$javaExecutable\"")" + javaHome=$(expr "$javaHome" : '\(.*\)/bin') + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=$(cd "$wdir/.." || exit 1; pwd) + fi + # end of workaround + done + printf '%s' "$(cd "$basedir" || exit 1; pwd)" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + # Remove \r in case we run on Windows within Git Bash + # and check out the repository with auto CRLF management + # enabled. Otherwise, we may read lines that are delimited with + # \r\n and produce $'-Xarg\r' rather than -Xarg due to word + # splitting rules. + tr -s '\r\n' ' ' < "$1" + fi +} + +log() { + if [ "$MVNW_VERBOSE" = true ]; then + printf '%s\n' "$1" + fi +} + +BASE_DIR=$(find_maven_basedir "$(dirname "$0")") +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR +log "$MAVEN_PROJECTBASEDIR" + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" +if [ -r "$wrapperJarPath" ]; then + log "Found $wrapperJarPath" +else + log "Couldn't find $wrapperJarPath, downloading it ..." + + if [ -n "$MVNW_REPOURL" ]; then + wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + else + wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + fi + while IFS="=" read -r key value; do + # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) + safeValue=$(echo "$value" | tr -d '\r') + case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; + esac + done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" + log "Downloading from: $wrapperUrl" + + if $cygwin; then + wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") + fi + + if command -v wget > /dev/null; then + log "Found wget ... using wget" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + log "Found curl ... using curl" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + else + curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + fi + else + log "Falling back to using Java to download" + javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" + javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaSource=$(cygpath --path --windows "$javaSource") + javaClass=$(cygpath --path --windows "$javaClass") + fi + if [ -e "$javaSource" ]; then + if [ ! -e "$javaClass" ]; then + log " - Compiling MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/javac" "$javaSource") + fi + if [ -e "$javaClass" ]; then + log " - Running MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +# If specified, validate the SHA-256 sum of the Maven wrapper jar file +wrapperSha256Sum="" +while IFS="=" read -r key value; do + case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; + esac +done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" +if [ -n "$wrapperSha256Sum" ]; then + wrapperSha256Result=false + if command -v sha256sum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + elif command -v shasum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." + echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." + exit 1 + fi + if [ $wrapperSha256Result = false ]; then + echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 + echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 + echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 + exit 1 + fi +fi + +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --windows "$CLASSPATH") + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +# shellcheck disable=SC2086 # safe args +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..c4586b5 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,205 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.2.0 +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %WRAPPER_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file +SET WRAPPER_SHA_256_SUM="" +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B +) +IF NOT %WRAPPER_SHA_256_SUM%=="" ( + powershell -Command "&{"^ + "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ + "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ + " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ + " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ + " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ + " exit 1;"^ + "}"^ + "}" + if ERRORLEVEL 1 goto error +) + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% From ee0882ac9f1c701df587da82d9f09d585ccd6c52 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 14 Mar 2024 16:18:06 +0100 Subject: [PATCH 43/95] Make mvnw executable --- mvnw | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 mvnw diff --git a/mvnw b/mvnw old mode 100644 new mode 100755 From fd163abe5c447a8c839540448389229e9c41fc9c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 00:53:50 +0000 Subject: [PATCH 44/95] Bump com.puppycrawl.tools:checkstyle from 10.14.1 to 10.14.2 Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 10.14.1 to 10.14.2. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-10.14.1...checkstyle-10.14.2) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- standard-maven-template-demo/pom.xml | 2 +- standard-maven-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index b6bb7ce..0219b22 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -92,7 +92,7 @@ com.puppycrawl.tools checkstyle - 10.14.1 + 10.14.2 diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index e8e6a24..a7273ed 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -216,7 +216,7 @@ com.puppycrawl.tools checkstyle - 10.14.1 + 10.14.2 From 3798841f3e5cdb52178c3f47dbfbf0622094b439 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 00:30:15 +0000 Subject: [PATCH 45/95] Bump org.apache.maven.plugins:maven-compiler-plugin Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.12.1 to 3.13.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.12.1...maven-compiler-plugin-3.13.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- standard-maven-template-demo/pom.xml | 2 +- standard-maven-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index b6bb7ce..b4b091b 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -41,7 +41,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.12.1 + 3.13.0 ${maven.compiler.release} diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index e8e6a24..da79080 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -118,7 +118,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.12.1 + 3.13.0 ${maven.compiler.release} From 9f760aa301dea0e29c4891ebc0c9daf47712904a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 00:30:19 +0000 Subject: [PATCH 46/95] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.0 to 3.2.1 Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.0 to 3.2.1. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.0...maven-gpg-plugin-3.2.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index e8e6a24..8543eb9 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -168,7 +168,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.0 + 3.2.1 sign-artifacts From 2bc07f70c33a1a5e4b329459fae379dd1e123728 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 00:30:23 +0000 Subject: [PATCH 47/95] Bump org.apache.maven.plugins:maven-assembly-plugin from 3.7.0 to 3.7.1 Bumps [org.apache.maven.plugins:maven-assembly-plugin](https://github.com/apache/maven-assembly-plugin) from 3.7.0 to 3.7.1. - [Release notes](https://github.com/apache/maven-assembly-plugin/releases) - [Commits](https://github.com/apache/maven-assembly-plugin/compare/maven-assembly-plugin-3.7.0...maven-assembly-plugin-3.7.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-assembly-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- standard-maven-template-demo/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index b6bb7ce..e8af754 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -52,7 +52,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.7.0 + 3.7.1 From 9b5b2f77ea937b4cff23dc9ae48fab60223c198d Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 25 Mar 2024 08:53:52 +0100 Subject: [PATCH 48/95] Fix mvnw location --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a7e212a..9971f28 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,12 +60,13 @@ jobs: - name: Un-SNAP run: | + mvnwPath=$(readlink -f ./mvnw) modules=("") # root modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0')) for i in "${modules[@]}" do echo "Processing $i/pom.xml" - (cd "$i" && ../mvnw -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false) + (cd "$i" && $mvnwPath -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false) done - name: Get version @@ -205,12 +206,13 @@ jobs: - name: Inc Version and SNAP run: | + mvnwPath=$(readlink -f ./mvnw) modules=("") # root modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0')) for i in "${modules[@]}" do echo "Processing $i/pom.xml" - (cd "$i" && ../mvnw -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true) + (cd "$i" && $mvnwPath -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true) done - name: Git Commit and Push From c1adfaf8851bf5b956110ff2bcee60f4f90b935b Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 26 Mar 2024 09:26:15 +0100 Subject: [PATCH 49/95] Correct SCM connection info --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index c5ce734..790b644 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -15,7 +15,7 @@ https://github.com/xdev-software/standard-maven-template - https://github.com/xdev-software/standard-maven-template.git + scm:git:https://github.com/xdev-software/standard-maven-template.git 2023 From 4e2aa3b725cd987a0855cb8e0e7f53ee82a9d5d1 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 26 Mar 2024 11:33:22 +0100 Subject: [PATCH 50/95] Improve pages representation * Use newer maven site plugin * Simplify release workflow * Use mvnw * Correct link --- .github/workflows/release.yml | 32 +++----------------------------- README.md | 2 +- standard-maven-template/pom.xml | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9971f28..46873c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -138,7 +138,6 @@ jobs: working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} publish-pages: - name: Publish dependencies and licenses to github pages runs-on: ubuntu-latest needs: [prepare_release] steps: @@ -157,40 +156,15 @@ jobs: distribution: 'temurin' cache: 'maven' - - name: Build dependencies/licenses files - run: mvn -B project-info-reports:dependencies + - name: Build site + run: ../mvnw -B site working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - - name: Upload licenses - Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: dependencies-licenses - path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/site - - - name: Generate docs/dependencies dir - run: mkdir -p docs/dependencies - - - name: Move built files into docs/dependencies - run: mv ${{ env.PRIMARY_MAVEN_MODULE }}/target/site/* docs/dependencies - - - name: Rename dependencies.html to index.html - working-directory: docs/dependencies - run: mv dependencies.html index.html - - - name: Copy Readme into docs (as index.md) - run: cp README.md docs/index.md - - - name: Configure Pages - working-directory: docs - run: |- - echo "theme: jekyll-theme-tactile" > _config.yml - - name: Deploy to Github pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs - enable_jekyll: true + publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site after_release: runs-on: ubuntu-latest diff --git a/README.md b/README.md index b90c3eb..db9412b 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,4 @@ If you need support as soon as possible and you can't wait for any pull request, See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project. ## Dependencies and Licenses -View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/standard-maven-template/dependencies/) +View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/standard-maven-template/dependencies) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 790b644..1cd4ae6 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -85,6 +85,20 @@ + + + + org.apache.maven.plugins + maven-site-plugin + 4.0.0-M13 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.5.0 + + + com.mycila From bc0cd3a944beef72e402f31a29d18f960bdaf887 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 26 Mar 2024 11:47:10 +0100 Subject: [PATCH 51/95] Update maven-gpg-plugin --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 1cd4ae6..e84ddff 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -182,7 +182,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.1 + 3.2.2 sign-artifacts From b2a23b191ccad41f0621dc197503591274e30494 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 00:21:42 +0000 Subject: [PATCH 52/95] Bump com.puppycrawl.tools:checkstyle from 10.14.2 to 10.15.0 Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 10.14.2 to 10.15.0. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-10.14.2...checkstyle-10.15.0) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- standard-maven-template-demo/pom.xml | 2 +- standard-maven-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index 2e466d4..0a4432d 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -92,7 +92,7 @@ com.puppycrawl.tools checkstyle - 10.14.2 + 10.15.0 diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index e84ddff..b7b0fc3 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -230,7 +230,7 @@ com.puppycrawl.tools checkstyle - 10.14.2 + 10.15.0 From 0af9590c417fb708ffe83f838f5308c9652143d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 00:42:48 +0000 Subject: [PATCH 53/95] Bump org.apache.maven.plugins:maven-source-plugin from 3.3.0 to 3.3.1 Bumps [org.apache.maven.plugins:maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.3.0 to 3.3.1. - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.3.0...maven-source-plugin-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-source-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index b7b0fc3..f25578a 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -161,7 +161,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.0 + 3.3.1 attach-sources From 84e5c3875da79de06f79ce1bbbf58c6d31ec6010 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Wed, 10 Apr 2024 11:18:26 +0000 Subject: [PATCH 54/95] Update dependency maven to v3.9.6 --- .mvn/wrapper/maven-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index eacdc9e..346d645 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar From a27c4efe8b86e58a5eb28e49e0192aec6a13a714 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Wed, 10 Apr 2024 11:18:27 +0000 Subject: [PATCH 55/95] Update peaceiris/actions-gh-pages action to v4 --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46873c7..4ad042f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -161,7 +161,7 @@ jobs: working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Deploy to Github pages - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site From 4865729466fda65da0fcc02386fa8b987c36d451 Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 10 Apr 2024 13:22:12 +0200 Subject: [PATCH 56/95] Modify workflows for renovate --- .github/workflows/checkBuild.yml | 1 + .github/workflows/sonar.yml | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index d3993c2..fa9b7f5 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -72,6 +72,7 @@ jobs: code-style: runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} strategy: matrix: diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index db10f67..1c9b0f8 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -27,8 +27,7 @@ jobs: sonar: name: SonarCloud Scan runs-on: ubuntu-latest - # Dependabot PRs have no access to secrets (SONAR_TOKEN) -> Ignore them - if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'dependabot/') }} + if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} steps: - uses: actions/checkout@v4 with: From d21aae6a70a926740e6448eda93e894efa2b2712 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 07:27:55 +0000 Subject: [PATCH 57/95] Update dependency org.apache.maven.plugins:maven-gpg-plugin to v3.2.3 --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index f25578a..5ee5275 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -182,7 +182,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.2 + 3.2.3 sign-artifacts From d1748a5779236e34017842ac8c2c759448261cad Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 16 Apr 2024 08:43:54 +0200 Subject: [PATCH 58/95] Update pom.xml Remove unused inception year in demo --- standard-maven-template-demo/pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index 0a4432d..a401ade 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -9,8 +9,6 @@ 1.0.0-SNAPSHOT jar - 2022 - XDEV Software https://xdev.software From fd9656a52e736915f5867868bfb7e2bec09968db Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Sat, 20 Apr 2024 02:15:22 +0000 Subject: [PATCH 59/95] Update dependency org.apache.maven.plugins:maven-gpg-plugin to v3.2.4 --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 5ee5275..f8facd6 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -182,7 +182,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.3 + 3.2.4 sign-artifacts From 34acb7c46c304632c0a5dede676c5857d12a76f5 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Sun, 21 Apr 2024 02:19:24 +0000 Subject: [PATCH 60/95] Update dependency maven-wrapper to v3.3.0 --- .mvn/wrapper/maven-wrapper.properties | 1 - mvnw | 428 +++++++++++--------------- mvnw.cmd | 301 ++++++++---------- 3 files changed, 306 insertions(+), 424 deletions(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 346d645..7f15621 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -15,4 +15,3 @@ # specific language governing permissions and limitations # under the License. distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar diff --git a/mvnw b/mvnw index 8d937f4..0830332 100755 --- a/mvnw +++ b/mvnw @@ -19,290 +19,232 @@ # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- -# Apache Maven Wrapper startup batch script, version 3.2.0 -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir +# Apache Maven Wrapper startup batch script, version 3.3.0 # # Optional ENV vars # ----------------- -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output # ---------------------------------------------------------------------------- -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /usr/local/etc/mavenrc ] ; then - . /usr/local/etc/mavenrc - fi - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false +# OS specific support. +native_path() { printf %s\\n "$1"; } case "$(uname)" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME - else - JAVA_HOME="/Library/Java/Home"; export JAVA_HOME - fi - fi - ;; +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; esac -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=$(java-config --jre-home) - fi -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$JAVA_HOME" ] && - JAVA_HOME=$(cygpath --unix "$JAVA_HOME") - [ -n "$CLASSPATH" ] && - CLASSPATH=$(cygpath --path --unix "$CLASSPATH") -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && - JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="$(which javac)" - if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=$(which readlink) - if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then - if $darwin ; then - javaHome="$(dirname "\"$javaExecutable\"")" - javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" - else - javaExecutable="$(readlink -f "\"$javaExecutable\"")" - fi - javaHome="$(dirname "\"$javaExecutable\"")" - javaHome=$(expr "$javaHome" : '\(.*\)/bin') - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" else JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi fi else - JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi fi +} - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=$(cd "$wdir/.." || exit 1; pwd) - fi - # end of workaround +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" done - printf '%s' "$(cd "$basedir" || exit 1; pwd)" + printf %x\\n $h } -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - # Remove \r in case we run on Windows within Git Bash - # and check out the repository with auto CRLF management - # enabled. Otherwise, we may read lines that are delimited with - # \r\n and produce $'-Xarg\r' rather than -Xarg due to word - # splitting rules. - tr -s '\r\n' ' ' < "$1" - fi +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 } -log() { - if [ "$MVNW_VERBOSE" = true ]; then - printf '%s\n' "$1" - fi +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl="${value-}" ;; + distributionSha256Sum) distributionSha256Sum="${value-}" ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_HOME="$HOME/.m2/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" } -BASE_DIR=$(find_maven_basedir "$(dirname "$0")") -if [ -z "$BASE_DIR" ]; then - exit 1; +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" fi -MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR -log "$MAVEN_PROJECTBASEDIR" +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" -if [ -r "$wrapperJarPath" ]; then - log "Found $wrapperJarPath" +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT else - log "Couldn't find $wrapperJarPath, downloading it ..." + die "cannot create temp dir" +fi - if [ -n "$MVNW_REPOURL" ]; then - wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" - else - wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" - fi - while IFS="=" read -r key value; do - # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) - safeValue=$(echo "$value" | tr -d '\r') - case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; - esac - done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" - log "Downloading from: $wrapperUrl" +mkdir -p -- "${MAVEN_HOME%/*}" - if $cygwin; then - wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") - fi +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" - if command -v wget > /dev/null; then - log "Found wget ... using wget" - [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" - else - wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - log "Found curl ... using curl" - [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" - else - curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" - fi - else - log "Falling back to using Java to download" - javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" - javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaSource=$(cygpath --path --windows "$javaSource") - javaClass=$(cygpath --path --windows "$javaClass") - fi - if [ -e "$javaSource" ]; then - if [ ! -e "$javaClass" ]; then - log " - Compiling MavenWrapperDownloader.java ..." - ("$JAVA_HOME/bin/javac" "$javaSource") - fi - if [ -e "$javaClass" ]; then - log " - Running MavenWrapperDownloader.java ..." - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" - fi - fi - fi +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" fi -########################################################################################## -# End of extension -########################################################################################## -# If specified, validate the SHA-256 sum of the Maven wrapper jar file -wrapperSha256Sum="" -while IFS="=" read -r key value; do - case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; - esac -done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" -if [ -n "$wrapperSha256Sum" ]; then - wrapperSha256Result=false - if command -v sha256sum > /dev/null; then - if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then - wrapperSha256Result=true +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( new java.net.URL( args[0] ).openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true fi - elif command -v shasum > /dev/null; then - if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then - wrapperSha256Result=true + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true fi else - echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." - echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 exit 1 fi - if [ $wrapperSha256Result = false ]; then - echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 - echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 - echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 exit 1 fi fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$JAVA_HOME" ] && - JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") - [ -n "$CLASSPATH" ] && - CLASSPATH=$(cygpath --path --windows "$CLASSPATH") - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -# shellcheck disable=SC2086 # safe args -exec "$JAVACMD" \ - $MAVEN_OPTS \ - $MAVEN_DEBUG_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" +clean || : +exec_maven "$@" diff --git a/mvnw.cmd b/mvnw.cmd index c4586b5..136e686 100644 --- a/mvnw.cmd +++ b/mvnw.cmd @@ -1,3 +1,4 @@ +<# : batch portion @REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @@ -18,188 +19,128 @@ @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- -@REM Apache Maven Wrapper startup batch script, version 3.2.0 -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir +@REM Apache Maven Wrapper startup batch script, version 3.3.0 @REM @REM Optional ENV vars -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output @REM ---------------------------------------------------------------------------- -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* -if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" - -FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %WRAPPER_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file -SET WRAPPER_SHA_256_SUM="" -FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) ) -IF NOT %WRAPPER_SHA_256_SUM%=="" ( - powershell -Command "&{"^ - "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ - "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ - " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ - " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ - " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ - " exit 1;"^ - "}"^ - "}" - if ERRORLEVEL 1 goto error -) - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% ^ - %JVM_CONFIG_MAVEN_PROPS% ^ - %MAVEN_OPTS% ^ - %MAVEN_DEBUG_OPTS% ^ - -classpath %WRAPPER_JAR% ^ - "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ - %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" -if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%"=="on" pause - -if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% - -cmd /C exit /B %ERROR_CODE% +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" From 29fd4deb26b6b013c857053364e1137556240c63 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 23 Apr 2024 08:43:43 +0200 Subject: [PATCH 61/95] Standardize template-placeholder I --- .run/Run Demo.run.xml | 2 +- CONTRIBUTING.md | 4 ++-- README.md | 12 ++++++------ pom.xml | 6 +++--- standard-maven-template-demo/pom.xml | 4 ++-- standard-maven-template/pom.xml | 12 ++++++------ 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.run/Run Demo.run.xml b/.run/Run Demo.run.xml index 764b3b9..5fb2bc2 100644 --- a/.run/Run Demo.run.xml +++ b/.run/Run Demo.run.xml @@ -1,7 +1,7 @@ - standard-maven-template - standard-maven-template-demo + template-placeholder + template-placeholder-demo diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index a401ade..78b4a3e 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -5,7 +5,7 @@ 4.0.0 software.xdev - standard-maven-template-demo + template-placeholder-demo 1.0.0-SNAPSHOT jar @@ -27,7 +27,7 @@ software.xdev - standard-maven-template + template-placeholder ${project.version} diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index f8facd6..b72a766 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -5,17 +5,17 @@ 4.0.0 software.xdev - standard-maven-template + template-placeholder 1.0.0-SNAPSHOT jar - standard-maven-template - standard-maven-template - https://github.com/xdev-software/standard-maven-template + template-placeholder + template-placeholder + https://github.com/xdev-software/template-placeholder - https://github.com/xdev-software/standard-maven-template - scm:git:https://github.com/xdev-software/standard-maven-template.git + https://github.com/xdev-software/template-placeholder + scm:git:https://github.com/xdev-software/template-placeholder.git 2023 From 7bed85040287fc665c6f60e7fd19c6534b16f886 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 23 Apr 2024 08:44:10 +0200 Subject: [PATCH 62/95] Standardize template-placeholder II --- .../pom.xml | 0 {standard-maven-template => template-placeholder}/pom.xml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {standard-maven-template-demo => template-placeholder-demo}/pom.xml (100%) rename {standard-maven-template => template-placeholder}/pom.xml (100%) diff --git a/standard-maven-template-demo/pom.xml b/template-placeholder-demo/pom.xml similarity index 100% rename from standard-maven-template-demo/pom.xml rename to template-placeholder-demo/pom.xml diff --git a/standard-maven-template/pom.xml b/template-placeholder/pom.xml similarity index 100% rename from standard-maven-template/pom.xml rename to template-placeholder/pom.xml From 9cdaa5e7b4eaddfcc80eb036c80ea5605d4d3fd4 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 23 Apr 2024 09:05:45 +0200 Subject: [PATCH 63/95] Remove unused empty line --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0760da8..8da47a0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ ## Installation [Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation) - ## 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). From 843acf00d18caea236bd9a620a20d50e060449d4 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:16:36 +0200 Subject: [PATCH 64/95] Update .gitattributes --- .gitattributes | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitattributes b/.gitattributes index dfe0770..9c74e42 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,9 @@ # Auto detect text files and perform LF normalization * text=auto + +# Force sh files to have LF +*.sh text eol=lf + +# Force MVN Wrapper Linux files LF +mvnw text eol=lf +.mvn/wrapper/maven-wrapper.properties text eol=lf From 2fddb4f8d67802420c6fe5ab905874257474528c Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Mon, 29 Apr 2024 02:19:20 +0000 Subject: [PATCH 65/95] Update dependency com.puppycrawl.tools:checkstyle to v10.16.0 --- template-placeholder-demo/pom.xml | 2 +- template-placeholder/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/template-placeholder-demo/pom.xml b/template-placeholder-demo/pom.xml index 78b4a3e..863e7bb 100644 --- a/template-placeholder-demo/pom.xml +++ b/template-placeholder-demo/pom.xml @@ -90,7 +90,7 @@ com.puppycrawl.tools checkstyle - 10.15.0 + 10.16.0 diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index b72a766..f05847e 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -230,7 +230,7 @@ com.puppycrawl.tools checkstyle - 10.15.0 + 10.16.0 From 80ca5915702edf25a92c75751418498dc8b09433 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 30 Apr 2024 11:20:37 +0200 Subject: [PATCH 66/95] Enable ``includeTestSourceDirectory`` Fix #48 --- template-placeholder-demo/pom.xml | 1 + template-placeholder/pom.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/template-placeholder-demo/pom.xml b/template-placeholder-demo/pom.xml index 863e7bb..b319445 100644 --- a/template-placeholder-demo/pom.xml +++ b/template-placeholder-demo/pom.xml @@ -95,6 +95,7 @@ ../.config/checkstyle/checkstyle.xml + true diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index f05847e..881534d 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -235,6 +235,7 @@ ../.config/checkstyle/checkstyle.xml + true From 2afe2fce60b15901230c31f68854c54919611799 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 6 May 2024 16:35:52 +0200 Subject: [PATCH 67/95] Update CONTRIBUTING.md Add note about (stealthy) Sonarlint telemetry --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d241a28..71adf87 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,6 +27,7 @@ You should have the following things installed: * Install the following plugins: * [Save Actions](https://plugins.jetbrains.com/plugin/22113) - Provides save actions, like running the formatter or adding ``final`` to fields * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis + * You may consider disabling telemetry in the settings under ``Tools > Sonarlint -> About`` * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis * Import the project * Ensure that everything is encoded in ``UTF-8`` From 451d36f3e2427c999d371ab07438ccb1ccd738d4 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 9 May 2024 02:20:36 +0000 Subject: [PATCH 68/95] Update dependency org.apache.maven.plugins:maven-site-plugin to v4.0.0-M14 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 881534d..0bf57cb 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -90,7 +90,7 @@ org.apache.maven.plugins maven-site-plugin - 4.0.0-M13 + 4.0.0-M14 org.apache.maven.plugins From 5a2a8da2c515f0ceb7c0c66d8f95c0049bf35c45 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Sun, 12 May 2024 02:22:20 +0000 Subject: [PATCH 69/95] Update dependency com.mycila:license-maven-plugin to v4.5 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 881534d..3b07391 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -103,7 +103,7 @@ com.mycila license-maven-plugin - 4.3 + 4.5 ${project.organization.url} From 8dbbdf91ff9f49dadba0277b776d3f79d6600ce1 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 13 May 2024 15:22:53 +0200 Subject: [PATCH 70/95] Ignore non resolveable links --- .github/.lycheeignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/.lycheeignore b/.github/.lycheeignore index 972ca61..dc88a07 100644 --- a/.github/.lycheeignore +++ b/.github/.lycheeignore @@ -1,2 +1,3 @@ # Ignorefile for broken link check localhost +mvnrepository.com From 97034e8c3c3edec50a154b6f895eec9d41b5ea3b Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Fri, 17 May 2024 09:01:17 +0200 Subject: [PATCH 71/95] Slight rewording --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71adf87..7f1156e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ We would absolutely love to get the community involved, and we welcome any form ### Ways to help * **Report bugs**
Create an issue or send a pull request * **Send pull requests**
If you want to contribute code, check out the development instructions below. - * However when contributing new features, please first discuss the change you wish to make via issue with the owners of this repository before making a change. Otherwise your work might be rejected and your effort was pointless. + * However when contributing larger new features, please first discuss the change you wish to make via issue with the owners of this repository before making it.
Otherwise your work might be rejected and your effort was pointless. We also encourage you to read the [contribution instructions by GitHub](https://docs.github.com/en/get-started/quickstart/contributing-to-projects). From 69604577dc40e6d61d57b4868839194bf16aaf02 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Sun, 26 May 2024 02:24:16 +0000 Subject: [PATCH 72/95] Update dependency maven to v3.9.7 --- .mvn/wrapper/maven-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 7f15621..f800e78 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip From f22a35b6327ac7f8c9af16da8b377c5a6770dc5f Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Mon, 27 May 2024 02:21:47 +0000 Subject: [PATCH 73/95] Update dependency com.puppycrawl.tools:checkstyle to v10.17.0 --- template-placeholder-demo/pom.xml | 2 +- template-placeholder/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/template-placeholder-demo/pom.xml b/template-placeholder-demo/pom.xml index b319445..f40d02e 100644 --- a/template-placeholder-demo/pom.xml +++ b/template-placeholder-demo/pom.xml @@ -90,7 +90,7 @@ com.puppycrawl.tools checkstyle - 10.16.0 + 10.17.0 diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index b9369a7..36e4236 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -230,7 +230,7 @@ com.puppycrawl.tools checkstyle - 10.16.0 + 10.17.0 From 457533698cb76fa8c50b82b99365e23737b843f0 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 27 May 2024 11:05:40 +0200 Subject: [PATCH 74/95] Only run sonar workflow when secret is present Fixes https://github.com/xdev-software/standard-maven-template/issues/57 --- .github/workflows/sonar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 1c9b0f8..061abbd 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -27,7 +27,7 @@ jobs: sonar: name: SonarCloud Scan runs-on: ubuntu-latest - if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} + if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) && secrets.SONAR_TOKEN != '' }} steps: - uses: actions/checkout@v4 with: From 403faee28d7778d19d589fa22e5f502bf4e8ed87 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 27 May 2024 16:08:06 +0200 Subject: [PATCH 75/95] Secrets are not available in if So let's startup a job before and check it there... You know because efficient design --- .github/workflows/sonar.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 061abbd..917868b 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -24,10 +24,22 @@ env: SONARCLOUD_HOST: https://sonarcloud.io jobs: + token-check: + runs-on: ubuntu-latest + outputs: + hasToken: ${{ steps.check-token.outputs.has }} + steps: + - id: check-token + run: | + [ -z $SONAR_TOKEN ] && echo "has=false" || echo "has=true" >> "$GITHUB_OUTPUT" + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + sonar: name: SonarCloud Scan runs-on: ubuntu-latest - if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) && secrets.SONAR_TOKEN != '' }} + needs: token-check + if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) && needs.token-check.outputs.hasToken }} steps: - uses: actions/checkout@v4 with: From d562e83d8ff58946f6ef75dcc86ab6ac9c139928 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Tue, 28 May 2024 02:21:58 +0000 Subject: [PATCH 76/95] Update dependency org.sonatype.plugins:nexus-staging-maven-plugin to v1.7.0 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 36e4236..7a44509 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -205,7 +205,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh From bef3a777eee48445b3c7c806da17ba7df91d156c Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 28 May 2024 08:23:59 +0200 Subject: [PATCH 77/95] Don't run sonar token check when not required --- .github/workflows/sonar.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 917868b..7824917 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -26,6 +26,7 @@ env: jobs: token-check: runs-on: ubuntu-latest + if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }} outputs: hasToken: ${{ steps.check-token.outputs.has }} steps: @@ -35,11 +36,10 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - sonar: - name: SonarCloud Scan + sonar-scan: runs-on: ubuntu-latest needs: token-check - if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) && needs.token-check.outputs.hasToken }} + if: ${{ needs.token-check.outputs.hasToken }} steps: - uses: actions/checkout@v4 with: From 8d48e75a2b3bc9535431421a4cd8bfb19c517530 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 28 May 2024 08:47:01 +0200 Subject: [PATCH 78/95] Compact/Flatten pom on release --- template-placeholder/pom.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 36e4236..d832697 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -179,6 +179,23 @@ ossrh + + org.codehaus.mojo + flatten-maven-plugin + 1.6.0 + + ossrh + + + + flatten + process-resources + + flatten + + + + org.apache.maven.plugins maven-gpg-plugin From a16ac0640bc49566cf4ecfcbcfb3d0c35db03c9f Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 28 May 2024 14:09:40 +0200 Subject: [PATCH 79/95] Standardize job names --- .github/workflows/release.yml | 16 ++++++++-------- .github/workflows/test-deploy.yml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ad042f..a1e3e8b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ permissions: pull-requests: write jobs: - check_code: # Validates the code + check-code: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -45,9 +45,9 @@ jobs: exit 1 fi - prepare_release: + prepare-release: runs-on: ubuntu-latest - needs: [check_code] + needs: [check-code] outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: @@ -106,9 +106,9 @@ jobs: ``` - publish_central: # Publish the code to central + publish-maven: runs-on: ubuntu-latest - needs: [prepare_release] + needs: [prepare-release] steps: - uses: actions/checkout@v4 @@ -139,7 +139,7 @@ jobs: publish-pages: runs-on: ubuntu-latest - needs: [prepare_release] + needs: [prepare-release] steps: - uses: actions/checkout@v4 @@ -166,9 +166,9 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site - after_release: + after-release: runs-on: ubuntu-latest - needs: [publish_central] + needs: [publish-maven] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index cdd96cc..9c07de2 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -7,7 +7,7 @@ env: PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} jobs: - publish_central: # Publish the code to central + publish-maven: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 4de451fa872278bcc682a234014fce0c08e8df88 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 28 May 2024 14:11:12 +0200 Subject: [PATCH 80/95] Substitute using repo name --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a1e3e8b..9a3c5da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -93,8 +93,8 @@ jobs: release_name: v${{ steps.version.outputs.release }} commitish: master body: | - ## [Changelog](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) - See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information. + ## [Changelog](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) + See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information. ## Installation Add the following lines to your pom: From 21769fcb17f890c24d9db4909552aa431b0ba947 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 28 May 2024 14:11:53 +0200 Subject: [PATCH 81/95] Normalize workflow names --- .github/workflows/{checkBuild.yml => check-build.yml} | 0 README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{checkBuild.yml => check-build.yml} (100%) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/check-build.yml similarity index 100% rename from .github/workflows/checkBuild.yml rename to .github/workflows/check-build.yml diff --git a/README.md b/README.md index 8da47a0..eccf80b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Latest version](https://img.shields.io/maven-central/v/software.xdev/template-placeholder?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/template-placeholder) -[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/checkBuild.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/checkBuild.yml?query=branch%3Adevelop) +[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/check-build.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/check-build.yml?query=branch%3Adevelop) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_template-placeholder&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_template-placeholder) # template-placeholder From 7ab86667b9fe51602690b0df081c47848195a834 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Sat, 1 Jun 2024 02:28:02 +0000 Subject: [PATCH 82/95] Update dependency org.apache.maven.plugins:maven-site-plugin to v4.0.0-M15 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index a1a300d..7a5c2dc 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -90,7 +90,7 @@ org.apache.maven.plugins maven-site-plugin - 4.0.0-M14 + 4.0.0-M15 org.apache.maven.plugins From 3b682e831f3f596ed23ba3ff2a643ea4ac6301fd Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Sat, 1 Jun 2024 02:28:04 +0000 Subject: [PATCH 83/95] Update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.7.0 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index a1a300d..0046bdb 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -143,7 +143,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.7.0 attach-javadocs From 3feccd234eb90229ff4887db845e87a37d0df9f7 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 6 Jun 2024 02:21:49 +0000 Subject: [PATCH 84/95] Update dependency org.apache.maven.plugins:maven-checkstyle-plugin to v3.4.0 --- pom.xml | 2 +- template-placeholder-demo/pom.xml | 2 +- template-placeholder/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 5da2110..8fc5ca9 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.3.1 + 3.4.0 true diff --git a/template-placeholder-demo/pom.xml b/template-placeholder-demo/pom.xml index f40d02e..326f855 100644 --- a/template-placeholder-demo/pom.xml +++ b/template-placeholder-demo/pom.xml @@ -85,7 +85,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.3.1 + 3.4.0 com.puppycrawl.tools diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 539a8a0..fb307dd 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -242,7 +242,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.3.1 + 3.4.0 com.puppycrawl.tools From 03dd57153ee758d4354a4fad9663e974dfb14e24 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Mon, 17 Jun 2024 02:25:02 +0000 Subject: [PATCH 85/95] Update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.6.0 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index fb307dd..5030ab1 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -95,7 +95,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.5.0 + 3.6.0 From 7313ce9b3960ac6cbca4f6b5e16d211463164bf8 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Tue, 18 Jun 2024 02:23:41 +0000 Subject: [PATCH 86/95] Update dependency maven to v3.9.8 --- .mvn/wrapper/maven-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index f800e78..e56bc18 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip From 43ddc48eac02aeaea23d332fd4c88bebf9e0c4f8 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:56:51 +0200 Subject: [PATCH 87/95] Attach demo to parent --- template-placeholder-demo/pom.xml | 39 +++++-------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/template-placeholder-demo/pom.xml b/template-placeholder-demo/pom.xml index 326f855..1af633c 100644 --- a/template-placeholder-demo/pom.xml +++ b/template-placeholder-demo/pom.xml @@ -4,7 +4,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - software.xdev + + software.xdev + template-placeholder-root + 1.0.0-SNAPSHOT + + template-placeholder-demo 1.0.0-SNAPSHOT jar @@ -77,36 +82,4 @@
- - - checkstyle - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.4.0 - - - com.puppycrawl.tools - checkstyle - 10.17.0 - - - - ../.config/checkstyle/checkstyle.xml - true - - - - - check - - - - - - - - From 3bc085a454ffefea389f3d3519e13445d97b60ef Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:57:26 +0200 Subject: [PATCH 88/95] Reconfigure root and add pmd --- pom.xml | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8fc5ca9..3a04c7a 100644 --- a/pom.xml +++ b/pom.xml @@ -19,6 +19,11 @@ template-placeholder-demo + + UTF-8 + UTF-8 + + Apache License, Version 2.0 @@ -29,7 +34,6 @@ - checkstyle @@ -37,12 +41,67 @@ org.apache.maven.plugins maven-checkstyle-plugin 3.4.0 + + + com.puppycrawl.tools + checkstyle + 10.17.0 + + + + .config/checkstyle/checkstyle.xml + true + + + + + check + + + +
+ + + + + pmd + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.23.0 - true + true + + .config/pmd/ruleset.xml + + + + net.sourceforge.pmd + pmd-core + 7.2.0 + + + net.sourceforge.pmd + pmd-java + 7.2.0 + + + + + + + org.apache.maven.plugins + maven-jxr-plugin + 3.4.0 + + + From f5240c0ba9f96827abdd6c76d072883bda47edec Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:57:44 +0200 Subject: [PATCH 89/95] Add pmd to published module --- template-placeholder/pom.xml | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 5030ab1..05a241f 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -265,5 +265,45 @@ + + pmd + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.23.0 + + true + + ../.config/pmd/ruleset.xml + + + + + net.sourceforge.pmd + pmd-core + 7.2.0 + + + net.sourceforge.pmd + pmd-java + 7.2.0 + + + + + + + + + + org.apache.maven.plugins + maven-jxr-plugin + 3.4.0 + + + + From 11c6f7e9bd7a831a0929da58d4143406f95eeede Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:59:00 +0200 Subject: [PATCH 90/95] Add pmd to check-build workflow --- .github/workflows/check-build.yml | 39 ++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index fa9b7f5..2ac6530 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -70,7 +70,7 @@ jobs: path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar if-no-files-found: error - code-style: + checkstyle: runs-on: ubuntu-latest if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} @@ -91,3 +91,40 @@ jobs: - name: Run Checkstyle run: ./mvnw -B checkstyle:check -P checkstyle -T2C + + pmd: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} + + strategy: + matrix: + java: [17] + distribution: [temurin] + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + cache: 'maven' + + - name: Run PMD + run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C + + - name: Run CPD (Copy Paste Detector) + run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C + + - name: Upload report + if: always() + uses: actions/upload-artifact@v4 + with: + 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 From d979ab94bb0a290219aef5cfbd97625843b93a8d Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 19 Jun 2024 08:41:49 +0200 Subject: [PATCH 91/95] PMD: printFailingErrors --- pom.xml | 1 + template-placeholder/pom.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 3a04c7a..e41a6a2 100644 --- a/pom.xml +++ b/pom.xml @@ -73,6 +73,7 @@ 3.23.0 true + true .config/pmd/ruleset.xml diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 05a241f..b743ae7 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -275,6 +275,7 @@ 3.23.0 true + true ../.config/pmd/ruleset.xml From 6a258c70a5b6a423ca90196e79f0b37a2a2302b3 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:02:41 +0200 Subject: [PATCH 92/95] Remove duplicate in .gitignore --- .gitignore | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitignore b/.gitignore index d0e81bf..116a656 100644 --- a/.gitignore +++ b/.gitignore @@ -39,11 +39,6 @@ buildNumber.properties # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* - -# bin / compiled stuff -target/ - - # JRebel **/resources/rebel.xml **/resources/rebel-remote.xml From f2290e689466bac63811f4ca96b6069ec1f9c8ee Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 24 Jun 2024 08:34:54 +0200 Subject: [PATCH 93/95] Ignore project internal depenedencies --- renovate.json5 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index 11a77b2..11024f4 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -1,4 +1,14 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "rebaseWhen": "behind-base-branch" + "rebaseWhen": "behind-base-branch", + "packageRules": [ + { + "description": "Ignore project internal dependencies", + "packagePattern": "^software.xdev:template-placeholder", + "datasources": [ + "maven" + ], + "enabled": false + } + ] } From 1cec0e0809e89e1bb27048655dcbcea3774da293 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 27 Jun 2024 02:23:10 +0000 Subject: [PATCH 94/95] Update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.6.1 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index b743ae7..a81bb5e 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -95,7 +95,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.6.0 + 3.6.1 From e8173207d21f81a971aa2822a169c4c651e5a03d Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 27 Jun 2024 15:34:27 +0200 Subject: [PATCH 95/95] Don't run tests when publishing in final phase --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a3c5da..89e654a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -130,7 +130,7 @@ jobs: gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - name: Publish to Apache Maven Central - run: ../mvnw -B deploy -Possrh + run: ../mvnw -B deploy -Possrh -DskipTests env: MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} @@ -157,7 +157,7 @@ jobs: cache: 'maven' - name: Build site - run: ../mvnw -B site + run: ../mvnw -B site -DskipTests working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Deploy to Github pages