Skip to content

Commit f9c05c7

Browse files
authored
Merge pull request #134 from xdev-software/develop
Release
2 parents 70a561a + b0ae2ea commit f9c05c7

File tree

18 files changed

+117
-100
lines changed

18 files changed

+117
-100
lines changed

.config/checkstyle/checkstyle.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<module name="TreeWalker">
5353
<!-- Checks - sorted alphabetically -->
5454
<module name="ArrayTypeStyle"/>
55+
<module name="AvoidDoubleBraceInitialization"/>
5556
<module name="AvoidStarImport"/>
5657
<module name="ConstantName"/>
5758
<module name="DefaultComesLast"/>
@@ -68,6 +69,11 @@
6869
<module name="FinalParameters"/>
6970
<module name="GenericWhitespace"/>
7071
<module name="HideUtilityClassConstructor"/>
72+
<module name="IllegalCatch">
73+
<!-- https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#avoidcatchingnpe -->
74+
<!-- https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#avoidcatchingthrowable -->
75+
<property name="illegalClassNames" value="Error,Throwable,NullPointerException,java.lang.Error,java.lang.Throwable,java.lang.NullPointerException"/>
76+
</module>
7177
<module name="IllegalImport"/>
7278
<module name="InterfaceIsType"/>
7379
<module name="JavadocStyle">
@@ -93,7 +99,6 @@
9399
<module name="MethodParamPad"/>
94100
<module name="MissingDeprecated"/>
95101
<module name="MissingOverride"/>
96-
<module name="MissingSwitchDefault"/>
97102
<module name="ModifierOrder"/>
98103
<module name="NeedBraces"/>
99104
<module name="NoClone"/>
@@ -122,7 +127,13 @@
122127
</module>
123128
<module name="TypecastParenPad"/>
124129
<module name="TypeName"/>
130+
<module name="UnnecessaryParentheses"/>
131+
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
132+
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
133+
<module name="UnnecessarySemicolonInEnumeration"/>
134+
<module name="UnnecessarySemicolonInTryWithResources"/>
125135
<module name="UnusedImports"/>
136+
<module name="UnusedLocalVariable"/>
126137
<module name="UpperEll"/>
127138
<module name="VisibilityModifier">
128139
<property name="packageAllowed" value="true"/>

.config/pmd/ruleset.xml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,38 @@
1010

1111
<!-- Only rules that don't overlap with CheckStyle! -->
1212

13+
<rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace"/>
14+
<rule ref="category/java/bestpractices.xml/AvoidStringBufferField"/>
1315
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"/>
16+
<rule ref="category/java/bestpractices.xml/ConstantsInInterface"/>
17+
<rule ref="category/java/bestpractices.xml/ExhaustiveSwitchHasDefault"/>
18+
<rule ref="category/java/bestpractices.xml/LiteralsFirstInComparisons"/>
19+
<!-- CheckStyle can't handle this switch behavior -> delegated to PMD -->
20+
<rule ref="category/java/bestpractices.xml/NonExhaustiveSwitch"/>
21+
<rule ref="category/java/bestpractices.xml/OneDeclarationPerLine">
22+
<properties>
23+
<property name="strictMode" value="true"/>
24+
</properties>
25+
</rule>
1426
<rule ref="category/java/bestpractices.xml/PreserveStackTrace"/>
27+
<rule ref="category/java/bestpractices.xml/SimplifiableTestAssertion"/>
28+
<rule ref="category/java/bestpractices.xml/SystemPrintln"/>
29+
<rule ref="category/java/bestpractices.xml/UnusedAssignment"/>
30+
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter"/>
31+
<rule ref="category/java/bestpractices.xml/UnusedPrivateField"/>
32+
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod"/>
1533
<rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty"/>
34+
<rule ref="category/java/bestpractices.xml/UseEnumCollections"/>
1635
<rule ref="category/java/bestpractices.xml/UseStandardCharsets"/>
36+
<rule ref="category/java/bestpractices.xml/UseTryWithResources"/>
1737

1838
<!-- Native code is platform dependent; Loading external native libs might pose a security threat -->
1939
<rule ref="category/java/codestyle.xml/AvoidUsingNativeCode"/>
2040
<rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/>
41+
<rule ref="category/java/codestyle.xml/LambdaCanBeMethodReference"/>
2142
<rule ref="category/java/codestyle.xml/NoPackage"/>
2243
<rule ref="category/java/codestyle.xml/PrematureDeclaration"/>
44+
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon"/>
2345

2446
<rule ref="category/java/design.xml">
2547
<!-- Sometimes abstract classes have just fields -->
@@ -76,9 +98,6 @@
7698

7799
<!-- Limit too low -->
78100
<exclude name="UseObjectForClearerAPI"/>
79-
80-
<!-- Handled by checkstyle -->
81-
<exclude name="UseUtilityClass"/>
82101
</rule>
83102

84103
<rule ref="category/java/design.xml/AvoidDeeplyNestedIfStmts">
@@ -114,17 +133,33 @@
114133
</properties>
115134
</rule>
116135

136+
<rule ref="category/java/errorprone.xml/AssignmentToNonFinalStatic"/>
137+
<rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
138+
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators"/>
117139
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/>
118140
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
119141
<rule ref="category/java/errorprone.xml/ComparisonWithNaN"/>
120142
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
121143
<rule ref="category/java/errorprone.xml/DontImportSun"/>
144+
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices"/>
145+
<rule ref="category/java/errorprone.xml/EqualsNull"/>
146+
<rule ref="category/java/errorprone.xml/IdempotentOperations"/>
147+
<rule ref="category/java/errorprone.xml/ImplicitSwitchFallThrough"/>
148+
<rule ref="category/java/errorprone.xml/InstantiationToGetClass"/>
149+
<rule ref="category/java/errorprone.xml/InvalidLogMessageFormat"/>
150+
<rule ref="category/java/errorprone.xml/JumbledIncrementer"/>
122151
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
152+
<rule ref="category/java/errorprone.xml/MoreThanOneLogger"/>
153+
<rule ref="category/java/errorprone.xml/NonStaticInitializer"/>
154+
<rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock"/>
155+
<rule ref="category/java/errorprone.xml/SingletonClassReturningNewInstance"/>
156+
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement"/>
123157
<rule ref="category/java/errorprone.xml/UnnecessaryCaseChange"/>
158+
<rule ref="category/java/errorprone.xml/UselessOperationOnImmutable"/>
124159

125160

126161
<rule ref="category/java/multithreading.xml">
127-
<!-- Just bloats code -->
162+
<!-- Just bloats code; improved in JEP-491/Java 24+ -->
128163
<exclude name="AvoidSynchronizedAtMethodLevel"/>
129164

130165
<!-- NOPE -->

.github/workflows/broken-links.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- name: Link Checker
2121
id: lychee
22-
uses: lycheeverse/lychee-action@v2
22+
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2
2323
with:
2424
fail: false # Don't fail on broken links, create an issue instead
2525

@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Create Issue From File
4040
if: env.lychee_exit_code != 0
41-
uses: peter-evans/create-issue-from-file@v5
41+
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5
4242
with:
4343
issue-number: ${{ steps.find-issue.outputs.number }}
4444
title: Link Checker Report

.github/workflows/check-build.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,4 @@ jobs:
127127
name: pmd-report
128128
if-no-files-found: ignore
129129
path: |
130-
target/site/*.html
131-
target/site/css/**
132-
target/site/images/logos/maven-feather.png
133-
target/site/images/external.png
130+
target/reports/**

.github/workflows/release.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
cache: 'maven'
2727

2828
- name: Build with Maven
29-
run: ./mvnw -B clean package
29+
run: ./mvnw -B clean package -T2C
3030

3131
- name: Check for uncommited changes
3232
run: |
@@ -64,7 +64,7 @@ jobs:
6464
run: |
6565
mvnwPath=$(readlink -f ./mvnw)
6666
modules=("") # root
67-
modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0'))
67+
modules+=($(grep -oP '(?<=<module>)[^<]+' 'pom.xml'))
6868
for i in "${modules[@]}"
6969
do
7070
echo "Processing $i/pom.xml"
@@ -89,7 +89,7 @@ jobs:
8989
9090
- name: Create Release
9191
id: create_release
92-
uses: shogo82148/actions-create-release@v1
92+
uses: shogo82148/actions-create-release@e5f206451d4ace2da9916d01f1aef279997f8659 # v1
9393
with:
9494
tag_name: v${{ steps.version.outputs.release }}
9595
release_name: v${{ steps.version.outputs.release }}
@@ -121,22 +121,22 @@ jobs:
121121
git config --global user.name "GitHub Actions"
122122
git pull
123123
124-
- name: Set up JDK Apache Maven Central
124+
- name: Set up JDK
125125
uses: actions/setup-java@v4
126126
with: # running setup-java again overwrites the settings.xml
127127
java-version: '17'
128128
distribution: 'temurin'
129-
server-id: ossrh
129+
server-id: sonatype-central-portal
130130
server-username: MAVEN_CENTRAL_USERNAME
131131
server-password: MAVEN_CENTRAL_TOKEN
132132
gpg-passphrase: MAVEN_GPG_PASSPHRASE
133133
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
134134

135-
- name: Publish to Apache Maven Central
136-
run: ../mvnw -B deploy -Possrh -DskipTests
135+
- name: Publish to Central Portal
136+
run: ../mvnw -B deploy -P publish-sonatype-central-portal -DskipTests
137137
env:
138-
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }}
139-
MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }}
138+
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}
139+
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }}
140140
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
141141
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
142142

@@ -165,7 +165,7 @@ jobs:
165165
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
166166

167167
- name: Deploy to Github pages
168-
uses: peaceiris/actions-gh-pages@v4
168+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
169169
with:
170170
github_token: ${{ secrets.GITHUB_TOKEN }}
171171
publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site
@@ -188,7 +188,7 @@ jobs:
188188
run: |
189189
mvnwPath=$(readlink -f ./mvnw)
190190
modules=("") # root
191-
modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0'))
191+
modules+=($(grep -oP '(?<=<module>)[^<]+' 'pom.xml'))
192192
for i in "${modules[@]}"
193193
do
194194
echo "Processing $i/pom.xml"

.github/workflows/sync-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ jobs:
2020
with:
2121
sparse-checkout: .github/labels.yml
2222

23-
- uses: EndBug/label-sync@v2
23+
- uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2
2424
with:
2525
config-file: .github/labels.yml

.github/workflows/test-deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16-
- name: Set up JDK OSSRH
16+
- name: Set up JDK
1717
uses: actions/setup-java@v4
1818
with: # running setup-java again overwrites the settings.xml
1919
distribution: 'temurin'
2020
java-version: '17'
21-
server-id: ossrh
21+
server-id: sonatype-central-portal
2222
server-username: MAVEN_CENTRAL_USERNAME
2323
server-password: MAVEN_CENTRAL_TOKEN
2424
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2525
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
2626

27-
- name: Publish to OSSRH
28-
run: ../mvnw -B deploy -Possrh -DskipTests
27+
- name: Publish to Central Portal
28+
run: ../mvnw -B deploy -P publish-sonatype-central-portal -DskipTests
2929
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
3030
env:
31-
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }}
32-
MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }}
31+
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}
32+
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }}
3333
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.github/workflows/update-from-template.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ jobs:
202202
GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
203203
run: |
204204
not_failed_conclusion="skipped|neutral|success"
205-
not_relevant_app_slug="dependabot|github-pages|sonarcloud"
205+
not_relevant_app_slug="dependabot|github-pages|sonarqubecloud"
206206
207207
echo "Waiting for checks to start..."
208208
sleep 40s
@@ -212,7 +212,7 @@ jobs:
212212
213213
echo "Checking if update-branch-merged exists"
214214
git fetch
215-
if [[ $(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
215+
if [[ $(git ls-remote --heads origin refs/heads/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
216216
echo "Branch still exists; Continuing..."
217217
else
218218
echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ hs_err_pid*
7171
.idea/*
7272
!.idea/saveactions_settings.xml
7373
!.idea/checkstyle-idea.xml
74+
!.idea/externalDependencies.xml
7475

7576
!.idea/inspectionProfiles/
7677
.idea/inspectionProfiles/*

.idea/externalDependencies.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 2.0.1
2+
* Migrated deployment to _Sonatype Maven Central Portal_ [#155](https://github.com/xdev-software/standard-maven-template/issues/155)
3+
* Updated dependencies
4+
15
# 2.0.0
26
* Added support for Spring Security 6.4+ / Spring Boot 3.4+ #100
37
* Spring now

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/spring-security-advanced-authentication-ui/check-build.yml?branch=develop)](https://github.com/xdev-software/spring-security-advanced-authentication-ui/actions/workflows/check-build.yml?query=branch%3Adevelop)
33
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_spring-security-advanced-authentication-ui&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_spring-security-advanced-authentication-ui)
44

5-
# spring-security-advanced-authentication-ui
5+
# Advanced authentication UI for Spring Security
66

77
Modernizes the default Spring Web Authentication/Login UI and makes it easier customizable.
88

@@ -35,7 +35,7 @@ A more detailed scenario is available in the [demo](./spring-security-advanced-a
3535
> [!NOTE]
3636
> By default [Bootstrap](https://github.com/twbs/bootstrap) is loaded from ``cdn.jsdelivr.net``.<br/>
3737
> Due to privacy and stability reasons you should ship your own version!<br/>
38-
> An example how this can be done is shown in the demo.
38+
> An example how this can be done is shown in the [demo](https://github.com/xdev-software/spring-security-advanced-authentication-ui/blob/4117d471e036de4dc2a58b2b484f2631afe7af50/spring-security-advanced-authentication-ui-demo/src/main/java/software/xdev/security/MainWebSecurity.java#L44-L51).
3939
4040
> [!NOTE]
4141
> The ``Advanced``-subsystem uses the pre-``Spring Security 6.4`` / ``Spring Boot 3.4`` templating system (without Regex).<br/>

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<licenses>
2828
<license>
29-
<name>Apache License, Version 2.0</name>
29+
<name>Apache-2.0</name>
3030
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
3131
<distribution>repo</distribution>
3232
</license>
@@ -45,7 +45,7 @@
4545
<dependency>
4646
<groupId>com.puppycrawl.tools</groupId>
4747
<artifactId>checkstyle</artifactId>
48-
<version>10.21.2</version>
48+
<version>10.23.1</version>
4949
</dependency>
5050
</dependencies>
5151
<configuration>
@@ -82,12 +82,12 @@
8282
<dependency>
8383
<groupId>net.sourceforge.pmd</groupId>
8484
<artifactId>pmd-core</artifactId>
85-
<version>7.10.0</version>
85+
<version>7.13.0</version>
8686
</dependency>
8787
<dependency>
8888
<groupId>net.sourceforge.pmd</groupId>
8989
<artifactId>pmd-java</artifactId>
90-
<version>7.10.0</version>
90+
<version>7.13.0</version>
9191
</dependency>
9292
</dependencies>
9393
</plugin>

spring-security-advanced-authentication-ui-demo/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
<mainClass>software.xdev.Application</mainClass>
3030

31-
<org.springframework.boot.version>3.4.2</org.springframework.boot.version>
31+
<org.springframework.boot.version>3.4.5</org.springframework.boot.version>
3232
</properties>
3333

3434
<dependencyManagement>
@@ -68,7 +68,7 @@
6868
<dependency>
6969
<groupId>com.webauthn4j</groupId>
7070
<artifactId>webauthn4j-core</artifactId>
71-
<version>0.28.5.RELEASE</version>
71+
<version>0.29.2.RELEASE</version>
7272
</dependency>
7373

7474
<dependency>
@@ -85,7 +85,7 @@
8585
<plugin>
8686
<groupId>org.apache.maven.plugins</groupId>
8787
<artifactId>maven-compiler-plugin</artifactId>
88-
<version>3.13.0</version>
88+
<version>3.14.0</version>
8989
<configuration>
9090
<release>${maven.compiler.release}</release>
9191
<compilerArgs>

spring-security-advanced-authentication-ui-demo/src/main/java/software/xdev/Application.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
55

66

7-
@SuppressWarnings("checkstyle:HideUtilityClassConstructor")
7+
@SuppressWarnings({"checkstyle:HideUtilityClassConstructor", "PMD.UseUtilityClass"})
88
@SpringBootApplication
99
public class Application
1010
{

0 commit comments

Comments
 (0)