Skip to content

Commit ebe84cf

Browse files
Merge branch 'develop' into openapi-client
2 parents d783ae3 + 9305fef commit ebe84cf

File tree

143 files changed

+17658
-329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+17658
-329
lines changed

.config/pmd/ruleset.xml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="Default"
3+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
6+
7+
<description>
8+
This ruleset checks the code for discouraged programming constructs.
9+
</description>
10+
11+
<!-- Only rules that don't overlap with CheckStyle! -->
12+
13+
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"/>
14+
<rule ref="category/java/bestpractices.xml/PreserveStackTrace"/>
15+
<rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty"/>
16+
<rule ref="category/java/bestpractices.xml/UseStandardCharsets"/>
17+
18+
<!-- Native code is platform dependent; Loading external native libs might pose a security threat -->
19+
<rule ref="category/java/codestyle.xml/AvoidUsingNativeCode"/>
20+
<rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/>
21+
<rule ref="category/java/codestyle.xml/NoPackage"/>
22+
<rule ref="category/java/codestyle.xml/PrematureDeclaration"/>
23+
24+
<rule ref="category/java/design.xml">
25+
<!-- Sometimes abstract classes have just fields -->
26+
<exclude name="AbstractClassWithoutAnyMethod"/>
27+
28+
<!-- Using RuntimeExceptions is ok -->
29+
<exclude name="AvoidCatchingGenericException"/>
30+
<exclude name="AvoidThrowingRawExceptionTypes"/>
31+
32+
<!-- Limit too low -->
33+
<exclude name="AvoidDeeplyNestedIfStmts"/>
34+
35+
<!-- Limit too low -->
36+
<exclude name="CouplingBetweenObjects"/>
37+
38+
<!-- Limit too low -->
39+
<exclude name="CyclomaticComplexity"/>
40+
41+
<!-- Makes entity classes impossible -->
42+
<exclude name="DataClass"/>
43+
44+
<!-- Used commonly particular in bigger methods with upstream throws -->
45+
<exclude name="ExceptionAsFlowControl"/>
46+
47+
<!-- Limit too low -->
48+
<exclude name="ExcessiveImports"/>
49+
50+
<!-- Handled by TooManyFields/TooManyMethods -->
51+
<exclude name="ExcessivePublicCount"/>
52+
53+
<!-- Prohibits accessing members using multiple depths -->
54+
<exclude name="LawOfDemeter"/>
55+
56+
<!-- No effect -->
57+
<exclude name="LoosePackageCoupling"/>
58+
59+
<!-- Prohibits singleton pattern -->
60+
<exclude name="MutableStaticState"/>
61+
62+
<!-- Checks LoC, already handled by Checkstyle -->
63+
<exclude name="NcssCount"/>
64+
65+
<!-- Some override methods or Junit require this -->
66+
<exclude name="SignatureDeclareThrowsException"/>
67+
68+
<!-- Reports FP for equals methods -->
69+
<exclude name="SimplifyBooleanReturns"/>
70+
71+
<!-- Limit too low -->
72+
<exclude name="TooManyFields"/>
73+
74+
<!-- Limit too low -->
75+
<exclude name="TooManyMethods"/>
76+
77+
<!-- Limit too low -->
78+
<exclude name="UseObjectForClearerAPI"/>
79+
80+
<!-- Handled by checkstyle -->
81+
<exclude name="UseUtilityClass"/>
82+
</rule>
83+
84+
<rule ref="category/java/design.xml/AvoidDeeplyNestedIfStmts">
85+
<properties>
86+
<property name="problemDepth" value="4"/>
87+
</properties>
88+
</rule>
89+
<rule ref="category/java/design.xml/CouplingBetweenObjects">
90+
<properties>
91+
<property name="threshold" value="100"/>
92+
</properties>
93+
</rule>
94+
<rule ref="category/java/design.xml/CyclomaticComplexity">
95+
<properties>
96+
<property name="classReportLevel" value="150"/>
97+
<property name="methodReportLevel" value="25"/>
98+
<property name="cycloOptions" value=""/>
99+
</properties>
100+
</rule>
101+
<rule ref="category/java/design.xml/ExcessiveImports">
102+
<properties>
103+
<property name="minimum" value="200"/>
104+
</properties>
105+
</rule>
106+
<rule ref="category/java/design.xml/TooManyFields">
107+
<properties>
108+
<property name="maxfields" value="50"/>
109+
</properties>
110+
</rule>
111+
<rule ref="category/java/design.xml/TooManyMethods">
112+
<properties>
113+
<property name="maxmethods" value="100"/>
114+
</properties>
115+
</rule>
116+
117+
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/>
118+
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
119+
<rule ref="category/java/errorprone.xml/ComparisonWithNaN"/>
120+
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
121+
<rule ref="category/java/errorprone.xml/DontImportSun"/>
122+
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
123+
<rule ref="category/java/errorprone.xml/UnnecessaryCaseChange"/>
124+
125+
126+
<rule ref="category/java/multithreading.xml">
127+
<!-- Just bloats code -->
128+
<exclude name="AvoidSynchronizedAtMethodLevel"/>
129+
130+
<!-- NOPE -->
131+
<exclude name="DoNotUseThreads"/>
132+
133+
<!-- Doesn't detect nested thread safe singleton pattern -->
134+
<exclude name="NonThreadSafeSingleton"/>
135+
136+
<!-- Should relevant for fields that use multithreading which is rare -->
137+
<exclude name="UseConcurrentHashMap"/>
138+
</rule>
139+
140+
<rule ref="category/java/performance.xml">
141+
<!-- This was fixed in Java 10 -->
142+
<exclude name="AvoidFileStream"/>
143+
144+
<!-- Used everywhere and has neglectable performance impact -->
145+
<exclude name="AvoidInstantiatingObjectsInLoops"/>
146+
147+
<!-- Handled by checkstyle -->
148+
<exclude name="RedundantFieldInitializer"/>
149+
150+
<!-- Nowadays optimized by compiler; No code bloating needed -->
151+
<exclude name="UseStringBufferForStringAppends"/>
152+
</rule>
153+
154+
<rule ref="category/java/performance.xml/TooFewBranchesForSwitch">
155+
<properties>
156+
<!-- If you have one case only please use a if -->
157+
<property name="minimumNumberCaseForASwitch" value="2"/>
158+
</properties>
159+
</rule>
160+
161+
<rule ref="category/java/security.xml"/>
162+
</ruleset>

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ body:
1414
attributes:
1515
label: "Checklist"
1616
options:
17-
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)"
17+
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/bzst-dip-java-client/releases/latest)"
1818
required: true
19-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
19+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/bzst-dip-java-client/issues) or [closed](https://github.com/xdev-software/bzst-dip-java-client/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
2020
required: true
2121
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
2222
required: true

.github/ISSUE_TEMPLATE/enhancement.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ body:
1212
attributes:
1313
label: "Checklist"
1414
options:
15-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
15+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/bzst-dip-java-client/issues) or [closed](https://github.com/xdev-software/bzst-dip-java-client/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1616
required: true
1717
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
1818
required: true

.github/ISSUE_TEMPLATE/question.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ body:
1212
attributes:
1313
label: "Checklist"
1414
options:
15-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
15+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/bzst-dip-java-client/issues) or [closed](https://github.com/xdev-software/bzst-dip-java-client/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1616
required: true
1717
- label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise."
1818
required: true

.github/workflows/broken-links.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ permissions:
1111
jobs:
1212
link-checker:
1313
runs-on: ubuntu-latest
14+
timeout-minutes: 15
1415
steps:
1516
- uses: actions/checkout@v4
1617

1718
- run: mv .github/.lycheeignore .lycheeignore
1819

1920
- name: Link Checker
2021
id: lychee
21-
uses: lycheeverse/lychee-action@v1
22+
uses: lycheeverse/lychee-action@v2
23+
with:
24+
fail: false # Don't fail on broken links, create an issue instead
2225

2326
- name: Find already existing issue
2427
id: find-issue

.github/workflows/checkBuild.yml renamed to .github/workflows/check-build.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ env:
2626
jobs:
2727
build:
2828
runs-on: ubuntu-latest
29+
timeout-minutes: 30
2930

3031
strategy:
3132
matrix:
@@ -70,9 +71,10 @@ jobs:
7071
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar
7172
if-no-files-found: error
7273

73-
code-style:
74+
checkstyle:
7475
runs-on: ubuntu-latest
7576
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
77+
timeout-minutes: 15
7678

7779
strategy:
7880
matrix:
@@ -91,3 +93,41 @@ jobs:
9193

9294
- name: Run Checkstyle
9395
run: ./mvnw -B checkstyle:check -P checkstyle -T2C
96+
97+
pmd:
98+
runs-on: ubuntu-latest
99+
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
100+
timeout-minutes: 15
101+
102+
strategy:
103+
matrix:
104+
java: [17]
105+
distribution: [temurin]
106+
107+
steps:
108+
- uses: actions/checkout@v4
109+
110+
- name: Set up JDK
111+
uses: actions/setup-java@v4
112+
with:
113+
distribution: ${{ matrix.distribution }}
114+
java-version: ${{ matrix.java }}
115+
cache: 'maven'
116+
117+
- name: Run PMD
118+
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C
119+
120+
- name: Run CPD (Copy Paste Detector)
121+
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C
122+
123+
- name: Upload report
124+
if: always()
125+
uses: actions/upload-artifact@v4
126+
with:
127+
name: pmd-report
128+
if-no-files-found: ignore
129+
path: |
130+
target/site/*.html
131+
target/site/css/**
132+
target/site/images/logos/maven-feather.png
133+
target/site/images/external.png

.github/workflows/release.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ permissions:
1212
pull-requests: write
1313

1414
jobs:
15-
check_code: # Validates the code
15+
check-code:
1616
runs-on: ubuntu-latest
17+
timeout-minutes: 30
1718
steps:
1819
- uses: actions/checkout@v4
1920

@@ -45,9 +46,10 @@ jobs:
4546
exit 1
4647
fi
4748
48-
prepare_release:
49+
prepare-release:
4950
runs-on: ubuntu-latest
50-
needs: [check_code]
51+
needs: [check-code]
52+
timeout-minutes: 10
5153
outputs:
5254
upload_url: ${{ steps.create_release.outputs.upload_url }}
5355
steps:
@@ -93,8 +95,8 @@ jobs:
9395
release_name: v${{ steps.version.outputs.release }}
9496
commitish: master
9597
body: |
96-
## [Changelog](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }})
97-
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.
98+
## [Changelog](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }})
99+
See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information.
98100
99101
## Installation
100102
Add the following lines to your pom:
@@ -106,9 +108,10 @@ jobs:
106108
</dependency>
107109
```
108110
109-
publish_central: # Publish the code to central
111+
publish-maven:
110112
runs-on: ubuntu-latest
111-
needs: [prepare_release]
113+
needs: [prepare-release]
114+
timeout-minutes: 60
112115
steps:
113116
- uses: actions/checkout@v4
114117

@@ -130,7 +133,7 @@ jobs:
130133
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
131134

132135
- name: Publish to Apache Maven Central
133-
run: ../mvnw -B deploy -Possrh
136+
run: ../mvnw -B deploy -Possrh -DskipTests
134137
env:
135138
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }}
136139
MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }}
@@ -139,7 +142,8 @@ jobs:
139142

140143
publish-pages:
141144
runs-on: ubuntu-latest
142-
needs: [prepare_release]
145+
needs: [prepare-release]
146+
timeout-minutes: 15
143147
steps:
144148
- uses: actions/checkout@v4
145149

@@ -157,7 +161,7 @@ jobs:
157161
cache: 'maven'
158162

159163
- name: Build site
160-
run: ../mvnw -B site
164+
run: ../mvnw -B compile site -DskipTests -T2C
161165
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
162166

163167
- name: Deploy to Github pages
@@ -166,9 +170,10 @@ jobs:
166170
github_token: ${{ secrets.GITHUB_TOKEN }}
167171
publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site
168172

169-
after_release:
173+
after-release:
170174
runs-on: ubuntu-latest
171-
needs: [publish_central]
175+
needs: [publish-maven]
176+
timeout-minutes: 10
172177
steps:
173178
- uses: actions/checkout@v4
174179

@@ -186,7 +191,7 @@ jobs:
186191
for i in "${modules[@]}"
187192
do
188193
echo "Processing $i/pom.xml"
189-
(cd "$i" && $mvnwPath -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true)
194+
(cd "$i" && $mvnwPath -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true -DupdateMatchingVersions=false)
190195
done
191196
192197
- name: Git Commit and Push

0 commit comments

Comments
 (0)