Skip to content

Commit 303aac9

Browse files
committed
Merge remote-tracking branch 'origin/update-from-template' into develop
2 parents a82088c + 42e244a commit 303aac9

File tree

8 files changed

+52
-20
lines changed

8 files changed

+52
-20
lines changed

.config/checkstyle/checkstyle.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@
7474
<!-- https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#avoidcatchingthrowable -->
7575
<property name="illegalClassNames" value="Error,Throwable,NullPointerException,java.lang.Error,java.lang.Throwable,java.lang.NullPointerException"/>
7676
</module>
77+
<!-- Do not allow params and vars to end with collection type names -->
78+
<module name="IllegalIdentifierName">
79+
<property name="format" value="^(?!(.*(Map|List|Set))$).+$"/>
80+
<property name="tokens" value="PARAMETER_DEF, VARIABLE_DEF, PATTERN_VARIABLE_DEF, RECORD_COMPONENT_DEF, LAMBDA"/>
81+
</module>
7782
<module name="IllegalImport"/>
7883
<module name="InterfaceIsType"/>
7984
<module name="JavadocStyle">
@@ -122,7 +127,10 @@
122127
<module name="StaticVariableName"/>
123128
<module name="StringLiteralEquality"/>
124129
<module name="SuppressWarningsHolder"/>
125-
<module name="TodoComment"/>
130+
<module name="TodoComment">
131+
<!-- Default is "TODO:" -->
132+
<property name="format" value="(?i)(TODO)"/>
133+
</module>
126134
<module name="TypecastParenPad"/>
127135
<module name="TypeName"/>
128136
<module name="UnnecessaryParentheses"/>

.config/pmd/java/ruleset.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,30 @@ If you are 100% sure that you escaped the value properly and you have no better
394394
</properties>
395395
</rule>
396396

397+
<!-- Jakarta Persistence -->
398+
<rule name="AvoidListAsEntityRelation"
399+
language="java"
400+
message="Use a Set instead of a List in entity relations"
401+
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"
402+
externalInfoUrl="https://www.baeldung.com/spring-jpa-onetomany-list-vs-set#bd-pros-and-cons">
403+
<description>
404+
`List` allows duplicates while a `Set` does not.
405+
A `Set` also prevents duplicates when the ORM reads multiple identical rows from the database (e.g. when using JOIN).
406+
</description>
407+
<priority>2</priority>
408+
<properties>
409+
<property name="xpath">
410+
<value>
411+
<![CDATA[
412+
//ClassDeclaration[pmd-java:hasAnnotation('jakarta.persistence.Entity')]
413+
//FieldDeclaration[pmd-java:hasAnnotation('jakarta.persistence.ManyToMany') or pmd-java:hasAnnotation('jakarta.persistence.OneToMany')]
414+
/ClassType[pmd-java:typeIs('java.util.List')]
415+
]]>
416+
</value>
417+
</property>
418+
</properties>
419+
</rule>
420+
397421

398422
<!-- Rules from JPinPoint with slight modifications -->
399423
<!-- https://github.com/jborgers/PMD-jPinpoint-rules -->

.github/workflows/check-build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
java-version: ${{ matrix.java }}
3838

3939
- name: Cache Maven
40-
uses: actions/cache@v4
40+
uses: actions/cache@v5
4141
with:
4242
path: ~/.m2/repository
4343
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
@@ -71,7 +71,7 @@ jobs:
7171
timeout-minutes: 15
7272
strategy:
7373
matrix:
74-
java: [17]
74+
java: [21]
7575
distribution: [temurin]
7676
steps:
7777
- uses: actions/checkout@v6
@@ -83,15 +83,15 @@ jobs:
8383
java-version: ${{ matrix.java }}
8484

8585
- name: Cache Maven
86-
uses: actions/cache@v4
86+
uses: actions/cache@v5
8787
with:
8888
path: ~/.m2/repository
8989
key: ${{ runner.os }}-mvn-checkstyle-${{ hashFiles('**/pom.xml') }}
9090
restore-keys: |
9191
${{ runner.os }}-mvn-checkstyle-
9292
9393
- name: CheckStyle Cache
94-
uses: actions/cache@v4
94+
uses: actions/cache@v5
9595
with:
9696
path: '**/target/checkstyle-cachefile'
9797
key: ${{ runner.os }}-checkstyle-${{ hashFiles('**/pom.xml') }}
@@ -119,15 +119,15 @@ jobs:
119119
java-version: ${{ matrix.java }}
120120

121121
- name: Cache Maven
122-
uses: actions/cache@v4
122+
uses: actions/cache@v5
123123
with:
124124
path: ~/.m2/repository
125125
key: ${{ runner.os }}-mvn-pmd-${{ hashFiles('**/pom.xml') }}
126126
restore-keys: |
127127
${{ runner.os }}-mvn-pmd-
128128
129129
- name: PMD Cache
130-
uses: actions/cache@v4
130+
uses: actions/cache@v5
131131
with:
132132
path: '**/target/pmd/pmd.cache'
133133
key: ${{ runner.os }}-pmd-${{ hashFiles('**/pom.xml') }}
@@ -142,7 +142,7 @@ jobs:
142142

143143
- name: Upload report
144144
if: always()
145-
uses: actions/upload-artifact@v5
145+
uses: actions/upload-artifact@v6
146146
with:
147147
name: pmd-report
148148
if-no-files-found: ignore

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
# Try to reuse existing cache from check-build
2727
- name: Try restore Maven Cache
28-
uses: actions/cache/restore@v4
28+
uses: actions/cache/restore@v5
2929
with:
3030
path: ~/.m2/repository
3131
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
@@ -87,7 +87,7 @@ jobs:
8787
8888
- name: Create Release
8989
id: create-release
90-
uses: shogo82148/actions-create-release@28d99e2a5b407558d17c15d0384fc0d7fb625b4c # v1
90+
uses: shogo82148/actions-create-release@559c27ce7eb834825e2b55927c64f6d1bd1db716 # v1
9191
with:
9292
tag_name: v${{ steps.version.outputs.release }}
9393
release_name: v${{ steps.version.outputs.release }}
@@ -187,7 +187,7 @@ jobs:
187187

188188
# Try to reuse existing cache from check-build
189189
- name: Try restore Maven Cache
190-
uses: actions/cache/restore@v4
190+
uses: actions/cache/restore@v5
191191
with:
192192
path: ~/.m2/repository
193193
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}

.idea/checkstyle-idea.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
wrapperVersion=3.3.4
22
distributionType=only-script
3-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
3+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip

client-storage/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
<plugin>
202202
<groupId>org.sonatype.central</groupId>
203203
<artifactId>central-publishing-maven-plugin</artifactId>
204-
<version>0.9.0</version>
204+
<version>0.10.0</version>
205205
<extensions>true</extensions>
206206
<configuration>
207207
<publishingServerId>sonatype-central-portal</publishingServerId>
@@ -223,7 +223,7 @@
223223
<dependency>
224224
<groupId>com.puppycrawl.tools</groupId>
225225
<artifactId>checkstyle</artifactId>
226-
<version>12.2.0</version>
226+
<version>13.0.0</version>
227227
</dependency>
228228
</dependencies>
229229
<configuration>
@@ -261,12 +261,12 @@
261261
<dependency>
262262
<groupId>net.sourceforge.pmd</groupId>
263263
<artifactId>pmd-core</artifactId>
264-
<version>7.19.0</version>
264+
<version>7.20.0</version>
265265
</dependency>
266266
<dependency>
267267
<groupId>net.sourceforge.pmd</groupId>
268268
<artifactId>pmd-java</artifactId>
269-
<version>7.19.0</version>
269+
<version>7.20.0</version>
270270
</dependency>
271271
</dependencies>
272272
</plugin>

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<dependency>
8989
<groupId>com.puppycrawl.tools</groupId>
9090
<artifactId>checkstyle</artifactId>
91-
<version>12.2.0</version>
91+
<version>13.0.0</version>
9292
</dependency>
9393
</dependencies>
9494
<configuration>
@@ -129,12 +129,12 @@
129129
<dependency>
130130
<groupId>net.sourceforge.pmd</groupId>
131131
<artifactId>pmd-core</artifactId>
132-
<version>7.19.0</version>
132+
<version>7.20.0</version>
133133
</dependency>
134134
<dependency>
135135
<groupId>net.sourceforge.pmd</groupId>
136136
<artifactId>pmd-java</artifactId>
137-
<version>7.19.0</version>
137+
<version>7.20.0</version>
138138
</dependency>
139139
</dependencies>
140140
</plugin>

0 commit comments

Comments
 (0)