Skip to content

Commit 68092b7

Browse files
committed
Merge remote-tracking branch 'origin/update-from-template' into develop
2 parents f6f7f99 + 42e244a commit 68092b7

File tree

8 files changed

+54
-22
lines changed

8 files changed

+54
-22
lines changed

.config/checkstyle/checkstyle.xml

Lines changed: 10 additions & 2 deletions
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">
@@ -91,7 +96,7 @@
9196
<property name="ignoreFieldDeclaration" value="true"/>
9297
<property name="ignoreHashCodeMethod" value="true"/>
9398
<!-- Defaults + other common constant values (e.g. time) -->
94-
<property name="ignoreNumbers" value="-1, 0, 1, 2, 3, 4, 5, 10, 12, 24, 31, 60, 100, 1000"/>
99+
<property name="ignoreNumbers" value="-1, 0, 1, 2, 3, 4, 5, 8, 10, 12, 16, 24, 25, 31, 32, 50, 60, 64, 100, 128, 200, 256, 500, 512, 1000, 1024, 2000, 2048, 4000, 4096, 8000, 8192"/>
95100
</module>
96101
<module name="MemberName"/>
97102
<module name="MethodLength"/>
@@ -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
@@ -28,7 +28,7 @@ jobs:
2828

2929
# Try to reuse existing cache from check-build
3030
- name: Try restore Maven Cache
31-
uses: actions/cache/restore@v4
31+
uses: actions/cache/restore@v5
3232
with:
3333
path: ~/.m2/repository
3434
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
@@ -91,7 +91,7 @@ jobs:
9191
9292
- name: Create Release
9393
id: create-release
94-
uses: shogo82148/actions-create-release@28d99e2a5b407558d17c15d0384fc0d7fb625b4c # v1
94+
uses: shogo82148/actions-create-release@559c27ce7eb834825e2b55927c64f6d1bd1db716 # v1
9595
with:
9696
tag_name: v${{ steps.version.outputs.release }}
9797
release_name: v${{ steps.version.outputs.release }}
@@ -179,7 +179,7 @@ jobs:
179179

180180
# Try to reuse existing cache from check-build
181181
- name: Try restore Maven Cache
182-
uses: actions/cache/restore@v4
182+
uses: actions/cache/restore@v5
183183
with:
184184
path: ~/.m2/repository
185185
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

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<dependency>
4545
<groupId>com.puppycrawl.tools</groupId>
4646
<artifactId>checkstyle</artifactId>
47-
<version>12.1.2</version>
47+
<version>13.0.0</version>
4848
</dependency>
4949
</dependencies>
5050
<configuration>
@@ -82,12 +82,12 @@
8282
<dependency>
8383
<groupId>net.sourceforge.pmd</groupId>
8484
<artifactId>pmd-core</artifactId>
85-
<version>7.18.0</version>
85+
<version>7.20.0</version>
8686
</dependency>
8787
<dependency>
8888
<groupId>net.sourceforge.pmd</groupId>
8989
<artifactId>pmd-java</artifactId>
90-
<version>7.18.0</version>
90+
<version>7.20.0</version>
9191
</dependency>
9292
</dependencies>
9393
</plugin>

selenium-elements/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
<plugin>
203203
<groupId>org.apache.maven.plugins</groupId>
204204
<artifactId>maven-source-plugin</artifactId>
205-
<version>3.3.1</version>
205+
<version>3.4.0</version>
206206
<executions>
207207
<execution>
208208
<id>attach-sources</id>
@@ -269,7 +269,7 @@
269269
<plugin>
270270
<groupId>org.sonatype.central</groupId>
271271
<artifactId>central-publishing-maven-plugin</artifactId>
272-
<version>0.9.0</version>
272+
<version>0.10.0</version>
273273
<extensions>true</extensions>
274274
<configuration>
275275
<publishingServerId>sonatype-central-portal</publishingServerId>
@@ -291,7 +291,7 @@
291291
<dependency>
292292
<groupId>com.puppycrawl.tools</groupId>
293293
<artifactId>checkstyle</artifactId>
294-
<version>12.1.2</version>
294+
<version>13.0.0</version>
295295
</dependency>
296296
</dependencies>
297297
<configuration>
@@ -329,12 +329,12 @@
329329
<dependency>
330330
<groupId>net.sourceforge.pmd</groupId>
331331
<artifactId>pmd-core</artifactId>
332-
<version>7.18.0</version>
332+
<version>7.20.0</version>
333333
</dependency>
334334
<dependency>
335335
<groupId>net.sourceforge.pmd</groupId>
336336
<artifactId>pmd-java</artifactId>
337-
<version>7.18.0</version>
337+
<version>7.20.0</version>
338338
</dependency>
339339
</dependencies>
340340
</plugin>

0 commit comments

Comments
 (0)