diff --git a/.config/checkstyle/checkstyle.xml b/.config/checkstyle/checkstyle.xml index a0d7f17..43b5290 100644 --- a/.config/checkstyle/checkstyle.xml +++ b/.config/checkstyle/checkstyle.xml @@ -52,6 +52,7 @@ + @@ -68,6 +69,11 @@ + + + + + @@ -93,7 +99,6 @@ - @@ -122,7 +127,13 @@ + + + + + + diff --git a/.config/pmd/ruleset.xml b/.config/pmd/ruleset.xml index 7a03f17..88a7b5a 100644 --- a/.config/pmd/ruleset.xml +++ b/.config/pmd/ruleset.xml @@ -10,16 +10,38 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -76,9 +98,6 @@ - - - @@ -114,17 +133,33 @@ + + + + + + + + + + + + + + + + - + diff --git a/.github/workflows/broken-links.yml b/.github/workflows/broken-links.yml index 8f98f1a..16a3f37 100644 --- a/.github/workflows/broken-links.yml +++ b/.github/workflows/broken-links.yml @@ -19,7 +19,7 @@ jobs: - name: Link Checker id: lychee - uses: lycheeverse/lychee-action@v2 + uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2 with: fail: false # Don't fail on broken links, create an issue instead @@ -38,7 +38,7 @@ jobs: - name: Create Issue From File if: env.lychee_exit_code != 0 - uses: peter-evans/create-issue-from-file@v5 + uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5 with: issue-number: ${{ steps.find-issue.outputs.number }} title: Link Checker Report diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index 0818116..01edc3a 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -127,7 +127,4 @@ jobs: 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 + target/reports/** diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 43767e8..2cb3393 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: cache: 'maven' - name: Build with Maven - run: ./mvnw -B clean package + run: ./mvnw -B clean package -T2C - name: Check for uncommited changes run: | @@ -64,7 +64,7 @@ jobs: run: | mvnwPath=$(readlink -f ./mvnw) modules=("") # root - modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0')) + modules+=($(grep -oP '(?<=)[^<]+' 'pom.xml')) for i in "${modules[@]}" do echo "Processing $i/pom.xml" @@ -89,7 +89,7 @@ jobs: - name: Create Release id: create_release - uses: shogo82148/actions-create-release@v1 + uses: shogo82148/actions-create-release@e5f206451d4ace2da9916d01f1aef279997f8659 # v1 with: tag_name: v${{ steps.version.outputs.release }} release_name: v${{ steps.version.outputs.release }} @@ -121,22 +121,22 @@ jobs: git config --global user.name "GitHub Actions" git pull - - name: Set up JDK Apache Maven Central + - name: Set up JDK uses: actions/setup-java@v4 with: # running setup-java again overwrites the settings.xml java-version: '17' distribution: 'temurin' - server-id: ossrh + server-id: sonatype-central-portal 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: ../mvnw -B deploy -Possrh -DskipTests + - name: Publish to Central Portal + run: ../mvnw -B deploy -P publish-sonatype-central-portal -DskipTests env: - MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} - MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} + MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} @@ -165,7 +165,7 @@ jobs: working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Deploy to Github pages - uses: peaceiris/actions-gh-pages@v4 + uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site @@ -188,7 +188,7 @@ jobs: run: | mvnwPath=$(readlink -f ./mvnw) modules=("") # root - modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0')) + modules+=($(grep -oP '(?<=)[^<]+' 'pom.xml')) for i in "${modules[@]}" do echo "Processing $i/pom.xml" diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index c9d7ec7..dc67287 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -20,6 +20,6 @@ jobs: with: sparse-checkout: .github/labels.yml - - uses: EndBug/label-sync@v2 + - uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2 with: config-file: .github/labels.yml diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 03f5339..8a85891 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -13,21 +13,21 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up JDK OSSRH + - name: Set up JDK uses: actions/setup-java@v4 with: # running setup-java again overwrites the settings.xml distribution: 'temurin' java-version: '17' - server-id: ossrh + server-id: sonatype-central-portal 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: ../mvnw -B deploy -Possrh -DskipTests + - name: Publish to Central Portal + run: ../mvnw -B deploy -P publish-sonatype-central-portal -DskipTests working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} env: - MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} - MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} + MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml index 6f9497e..65f56b0 100644 --- a/.github/workflows/update-from-template.yml +++ b/.github/workflows/update-from-template.yml @@ -202,7 +202,7 @@ jobs: GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }} run: | not_failed_conclusion="skipped|neutral|success" - not_relevant_app_slug="dependabot|github-pages|sonarcloud" + not_relevant_app_slug="dependabot|github-pages|sonarqubecloud" echo "Waiting for checks to start..." sleep 40s @@ -212,7 +212,7 @@ jobs: echo "Checking if update-branch-merged exists" git fetch - if [[ $(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then + if [[ $(git ls-remote --heads origin refs/heads/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then echo "Branch still exists; Continuing..." else echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing" diff --git a/.gitignore b/.gitignore index 116a656..5c85054 100644 --- a/.gitignore +++ b/.gitignore @@ -71,6 +71,7 @@ hs_err_pid* .idea/* !.idea/saveactions_settings.xml !.idea/checkstyle-idea.xml +!.idea/externalDependencies.xml !.idea/inspectionProfiles/ .idea/inspectionProfiles/* diff --git a/.idea/externalDependencies.xml b/.idea/externalDependencies.xml new file mode 100644 index 0000000..78be5b8 --- /dev/null +++ b/.idea/externalDependencies.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a3ace70..285a620 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.0.1 +* Migrated deployment to _Sonatype Maven Central Portal_ [#155](https://github.com/xdev-software/standard-maven-template/issues/155) +* Updated dependencies + # 2.0.0 * Added support for Spring Security 6.4+ / Spring Boot 3.4+ #100 * Spring now diff --git a/README.md b/README.md index 65404ac..60cca6d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![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) [![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) -# spring-security-advanced-authentication-ui +# Advanced authentication UI for Spring Security Modernizes the default Spring Web Authentication/Login UI and makes it easier customizable. @@ -35,7 +35,7 @@ A more detailed scenario is available in the [demo](./spring-security-advanced-a > [!NOTE] > By default [Bootstrap](https://github.com/twbs/bootstrap) is loaded from ``cdn.jsdelivr.net``.
> Due to privacy and stability reasons you should ship your own version!
-> An example how this can be done is shown in the demo. +> 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). > [!NOTE] > The ``Advanced``-subsystem uses the pre-``Spring Security 6.4`` / ``Spring Boot 3.4`` templating system (without Regex).
diff --git a/pom.xml b/pom.xml index a2bd6fe..6dca30b 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ - Apache License, Version 2.0 + Apache-2.0 https://www.apache.org/licenses/LICENSE-2.0.txt repo @@ -45,7 +45,7 @@ com.puppycrawl.tools checkstyle - 10.21.2 + 10.23.1 @@ -82,12 +82,12 @@ net.sourceforge.pmd pmd-core - 7.10.0 + 7.13.0 net.sourceforge.pmd pmd-java - 7.10.0 + 7.13.0 diff --git a/spring-security-advanced-authentication-ui-demo/pom.xml b/spring-security-advanced-authentication-ui-demo/pom.xml index 579be61..fbdbc63 100644 --- a/spring-security-advanced-authentication-ui-demo/pom.xml +++ b/spring-security-advanced-authentication-ui-demo/pom.xml @@ -28,7 +28,7 @@ software.xdev.Application - 3.4.2 + 3.4.5 @@ -68,7 +68,7 @@ com.webauthn4j webauthn4j-core - 0.28.5.RELEASE + 0.29.2.RELEASE @@ -85,7 +85,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.13.0 + 3.14.0 ${maven.compiler.release} diff --git a/spring-security-advanced-authentication-ui-demo/src/main/java/software/xdev/Application.java b/spring-security-advanced-authentication-ui-demo/src/main/java/software/xdev/Application.java index 83fe4b1..0491f09 100644 --- a/spring-security-advanced-authentication-ui-demo/src/main/java/software/xdev/Application.java +++ b/spring-security-advanced-authentication-ui-demo/src/main/java/software/xdev/Application.java @@ -4,7 +4,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; -@SuppressWarnings("checkstyle:HideUtilityClassConstructor") +@SuppressWarnings({"checkstyle:HideUtilityClassConstructor", "PMD.UseUtilityClass"}) @SpringBootApplication public class Application { diff --git a/spring-security-advanced-authentication-ui/pom.xml b/spring-security-advanced-authentication-ui/pom.xml index 400ccca..7935212 100644 --- a/spring-security-advanced-authentication-ui/pom.xml +++ b/spring-security-advanced-authentication-ui/pom.xml @@ -35,7 +35,7 @@ - Apache License, Version 2.0 + Apache-2.0 https://www.apache.org/licenses/LICENSE-2.0.txt repo @@ -49,59 +49,24 @@ UTF-8 - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - - org.springframework.boot spring-boot-starter-web - 3.4.2 + 3.4.5 provided org.springframework.boot spring-boot-starter-security - 3.4.2 + 3.4.5 provided org.junit.jupiter junit-jupiter - 5.11.4 + 5.12.2 test @@ -117,7 +82,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.8.0 + 3.9.0 @@ -125,7 +90,7 @@ com.mycila license-maven-plugin - 4.6 + 5.0.0 ${project.organization.url} @@ -154,7 +119,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.13.0 + 3.14.0 ${maven.compiler.release} @@ -198,19 +163,19 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 - ossrh + publish-sonatype-central-portal org.codehaus.mojo flatten-maven-plugin - 1.6.0 + 1.7.0 ossrh @@ -248,16 +213,13 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.7.0 + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 true - ossrh - https://s01.oss.sonatype.org/ - - 30 - true + sonatype-central-portal + true @@ -275,7 +237,7 @@ com.puppycrawl.tools checkstyle - 10.21.2 + 10.23.1 @@ -312,12 +274,12 @@ net.sourceforge.pmd pmd-core - 7.10.0 + 7.13.0 net.sourceforge.pmd pmd-java - 7.10.0 + 7.13.0 diff --git a/spring-security-advanced-authentication-ui/src/main/java/software/xdev/spring/security/web/authentication/ui/extendable/ExtendableLoginPageAdapter.java b/spring-security-advanced-authentication-ui/src/main/java/software/xdev/spring/security/web/authentication/ui/extendable/ExtendableLoginPageAdapter.java index 8fa3903..45fa519 100644 --- a/spring-security-advanced-authentication-ui/src/main/java/software/xdev/spring/security/web/authentication/ui/extendable/ExtendableLoginPageAdapter.java +++ b/spring-security-advanced-authentication-ui/src/main/java/software/xdev/spring/security/web/authentication/ui/extendable/ExtendableLoginPageAdapter.java @@ -203,7 +203,7 @@ protected ExtendableLoginPageAdapter( this.copyDataFromExistingFilters = copyDataFromExistingFilters; this.installUsingInitMethod = installWith == InstallWith.INIT_METHOD - || (installWith == null && httpSecurity == null); + || installWith == null && httpSecurity == null; if(!this.installUsingInitMethod) { diff --git a/spring-security-advanced-authentication-ui/src/main/java/software/xdev/spring/security/web/authentication/ui/extendable/filters/HtmlTemplates.java b/spring-security-advanced-authentication-ui/src/main/java/software/xdev/spring/security/web/authentication/ui/extendable/filters/HtmlTemplates.java index 00783e0..580e408 100644 --- a/spring-security-advanced-authentication-ui/src/main/java/software/xdev/spring/security/web/authentication/ui/extendable/filters/HtmlTemplates.java +++ b/spring-security-advanced-authentication-ui/src/main/java/software/xdev/spring/security/web/authentication/ui/extendable/filters/HtmlTemplates.java @@ -31,9 +31,9 @@ * @author Daniel Garnier-Moiroux * @since 6.4 */ -public class HtmlTemplates +public final class HtmlTemplates { - protected HtmlTemplates() + private HtmlTemplates() { }