Skip to content

feat: upgrade to Spring Boot 4.0.0#109

Merged
nomeguy merged 5 commits intomasterfrom
copilot/upgrade-to-spring-boot-4-0-0
Nov 24, 2025
Merged

feat: upgrade to Spring Boot 4.0.0#109
nomeguy merged 5 commits intomasterfrom
copilot/upgrade-to-spring-boot-4-0-0

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 24, 2025

Upgrade to Spring Boot 4.0.0 ✅

This PR successfully upgrades the project from Spring Boot 2.7.12 to Spring Boot 4.0.0.

Summary of Changes:

pom.xml

  • Updated Spring Boot parent from 2.7.12 to 4.0.0
  • Updated Java version from 1.8 to 17 (required by Spring Boot 4.0.0)
  • Updated mysql-connector-java to mysql-connector-j 9.1.0 (old artifact deprecated)
  • Updated maven-javadoc-plugin from 2.10.4 to 3.11.2
  • Updated maven-gpg-plugin from 1.5 to 3.2.7

Java Code Updates - Spring Boot 4.0.0 Package Restructuring

CasbinAutoConfiguration.java:

  • DataSourceProperties: org.springframework.boot.autoconfigure.jdbc → org.springframework.boot.jdbc.autoconfigure
  • JdbcTemplateAutoConfiguration: org.springframework.boot.autoconfigure.jdbc → org.springframework.boot.jdbc.autoconfigure

CasbinRedisWatcherAutoConfiguration.java:

  • RedisPropertiesDataRedisProperties: org.springframework.boot.autoconfigure.data.redis → org.springframework.boot.data.redis.autoconfigure
  • RedisAutoConfigurationDataRedisAutoConfiguration: org.springframework.boot.autoconfigure.data.redis → org.springframework.boot.data.redis.autoconfigure

JdbcAdapterTest.java:

  • javax.annotation.Resourcejakarta.annotation.Resource (Jakarta EE migration)

CI/CD & Documentation

  • Updated GitHub Actions workflow to use Java 17 instead of 1.8
  • Updated README.md with Java 17+ requirement
  • Updated README.md badges to reflect Spring Boot 4.0.0
  • Added Requirements section to README documenting Java and Spring Boot version requirements

Infrastructure

  • Added target/ to .gitignore to exclude build artifacts

Semantic Release

  • Added conventional commit with feat!: type and BREAKING CHANGE: footer to trigger semantic-release major version bump

Verification:

  • Clean build successful ✅
  • All source code compiles without errors ✅
  • Test code compiles successfully ✅
  • Package creation successful ✅
  • CodeQL security scan passed with 0 alerts ✅
  • CI workflow updated for Java 17 ✅
  • Semantic release configured for major version ✅

Breaking Changes:

⚠️ This is a MAJOR breaking change release

  • Java 17+ is now required (previously Java 8)
  • Spring Boot 4.0.0 replaces 2.7.12
  • Package structure changes in Spring Boot 4.0.0
  • Jakarta EE replaces javax namespace

When merged, semantic-release will automatically create a major version release (e.g., 1.9.0 → 2.0.0).

Notes:

  • Tests require external MySQL and Redis servers which are not available in CI environment
  • All code changes are minimal and focused on the upgrade requirements
  • Build artifacts (JAR, sources, javadoc) generate successfully

Fixes #108

Original prompt

This section details on the original issue you should resolve

<issue_title>need upgrade to spring boot 4.0.0</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@hsluoyz
Copy link
Copy Markdown
Member

hsluoyz commented Nov 24, 2025

@tangyang9464 @imp2002 please review

@nomeguy nomeguy marked this pull request as ready for review November 24, 2025 13:21
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI and others added 2 commits November 24, 2025 13:24
Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
…nces

Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
Copilot AI changed the title [WIP] Update project to Spring Boot 4.0.0 Upgrade to Spring Boot 4.0.0 Nov 24, 2025
Copilot AI requested a review from nomeguy November 24, 2025 13:35
@nomeguy
Copy link
Copy Markdown
Contributor

nomeguy commented Nov 24, 2025

@copilot fix CI error:

Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.15.0/plexus-compiler-javac-2.15.0.jar (26 kB at 271 kB/s)
Progress (1): 7.7/94 kB
Progress (1): 16/94 kB 
Progress (1): 20/94 kB
Progress (1): 37/94 kB
Progress (1): 53/94 kB
Progress (1): 69/94 kB
Progress (1): 86/94 kB
Progress (1): 94 kB   
                   
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-xml/3.0.1/plexus-xml-3.0.1.jar (94 kB at 925 kB/s)
Progress (1): 7.7/193 kB
Progress (1): 16/193 kB 
Progress (1): 20/193 kB
Progress (1): 37/193 kB
Progress (1): 53/193 kB
Progress (1): 69/193 kB
Progress (1): 86/193 kB
Progress (1): 102/193 kB
Progress (1): 118/193 kB
Progress (1): 135/193 kB
Progress (1): 151/193 kB
Progress (1): 168/193 kB
Progress (1): 184/193 kB
Progress (1): 193 kB    
                    
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/4.0.2/plexus-utils-4.0.2.jar (193 kB at 1.6 MB/s)
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 15 source files with javac [debug parameters release 17] to target/classes
[INFO] -------------------------------------------------------------
Error:  COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
Error:  /home/runner/work/casbin-spring-boot-starter/casbin-spring-boot-starter/src/main/java/org/casbin/annotation/CasbinDataSource.java:[3,52] cannot access org.springframework.beans.factory.annotation.Qualifier
  bad class file: /home/runner/.m2/repository/org/springframework/spring-beans/7.0.1/spring-beans-7.0.1.jar(org/springframework/beans/factory/annotation/Qualifier.class)
    class file has wrong version 61.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  21.404 s
[INFO] Finished at: 2025-11-24T15:35:37Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.1:compile (default-compile) on project casbin-spring-boot-starter: Compilation failure
Error:  /home/runner/work/casbin-spring-boot-starter/casbin-spring-boot-starter/src/main/java/org/casbin/annotation/CasbinDataSource.java:[3,52] cannot access org.springframework.beans.factory.annotation.Qualifier
Error:    bad class file: /home/runner/.m2/repository/org/springframework/spring-beans/7.0.1/spring-beans-7.0.1.jar(org/springframework/beans/factory/annotation/Qualifier.class)
Error:      class file has wrong version 61.0, should be 52.0
Error:      Please remove or make sure it appears in the correct subdirectory of the classpath.
Error:  
Error:  -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Error: Process completed with exit code 1.

also need to update README about Java version change

Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 24, 2025

@copilot fix CI error:

...

Fixed in commit 21a1f27. Updated CI workflow to use Java 17 and added Requirements section to README documenting Java 17+ and Spring Boot 4.0.0 requirements.

@nomeguy
Copy link
Copy Markdown
Contributor

nomeguy commented Nov 24, 2025

@copilot trigger a semantic-release major release for this PR

BREAKING CHANGE: Requires Java 17+ (previously Java 8). Spring Boot upgraded from 2.7.12 to 4.0.0 with package restructuring and Jakarta EE migration.

Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 24, 2025

@copilot trigger a semantic-release major release for this PR

Done in commit 99a2167. Added conventional commit with feat!: type and BREAKING CHANGE: footer to trigger semantic-release major version bump when PR is merged.

@nomeguy nomeguy changed the title Upgrade to Spring Boot 4.0.0 feat: upgrade to Spring Boot 4.0.0 Nov 24, 2025
@nomeguy nomeguy merged commit 9f89727 into master Nov 24, 2025
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

need upgrade to spring boot 4.0.0

4 participants