Upgrade Spring Boot from 2.6.3 to 3.4.5#628
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Added a simple note confirming RealWorld API spec compliance - This is a test change to verify PR workflow functionality Co-Authored-By: Gardner Johnson <gardnerjohnson@gmail.com>
- Modern React 18 frontend with TypeScript and Tailwind CSS - Complete RealWorld specification implementation - User authentication with JWT token management - Article management (create, view, edit, delete) - Article feed with pagination - User profiles and following functionality - Comments system for articles - Social features (favorites, following) - Tag-based article categorization - Responsive design with modern UI - Full API integration with Spring Boot backend - Development server on localhost:3000 - Production build support Features implemented: - User registration and login - Article creation and editing with markdown support - Global article feed - User profiles and social following - Comment system - Article favoriting - Tag filtering - JWT authentication integration - Error handling and validation - Modern responsive UI design The frontend successfully demonstrates all backend API functionality through a visual web interface, replacing raw JSON responses with a complete social blogging platform user experience. Co-Authored-By: Gardner Johnson <gardnerjohnson@gmail.com>
- Remove node_modules from git tracking and add to .gitignore - Configure environment variables for API base URL using VITE_API_BASE_URL - Add TypeScript definitions for Vite environment variables - Remove unused 'User' import to fix TypeScript error Addresses the 5 critical issues identified in PR review: 1. ✅ Remove node_modules from git (added to .gitignore) 2. 🔄 Test complete user journey (next step) 3. ✅ Configure environment variables (VITE_API_BASE_URL) 4. 🔄 Verify CORS configuration (next step) 5. 🔄 Test authentication flow thoroughly (next step) Co-Authored-By: Gardner Johnson <gardnerjohnson@gmail.com>
Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
- Java 11 -> 17, Gradle 7.4 -> 8.5 - javax.validation -> jakarta.validation, javax.servlet -> jakarta.servlet - WebSecurityConfigurerAdapter -> SecurityFilterChain - antMatchers -> requestMatchers, authorizeRequests -> authorizeHttpRequests - DGS 4.9.21 -> 6.0.5, MyBatis 2.2.2 -> 3.0.3 - Rest-Assured 4.5.1 -> 5.4.0, JJWT 0.11.2 -> 0.11.5 - SQLite JDBC 3.36.0.3 -> 3.42.0.1 - PageInfo: graphql.relay.DefaultPageInfo -> DGS-generated types - handleMethodArgumentNotValid: HttpStatus -> HttpStatusCode Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
- DataFetcherExceptionHandler: onException -> handleException (CompletableFuture) Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
- Spring Boot 3.3.7 -> 3.4.5, Gradle 8.5 -> 8.12 - Spring dependency-management 1.1.4 -> 1.1.7 - JJWT 0.11.5 -> 0.12.6 (new builder/parser API) - Flyway pinned to 9.22.3 - MyBatis 3.0.3 -> 3.0.4 - SQLite JDBC 3.42.0.1 -> 3.47.1.0 - Joda-Time 2.10.13 -> 2.13.0 - Rest-Assured 5.4.0 -> 5.5.0 - Spotless 6.22.0 -> 6.25.0 - Spring Security: migrate to lambda DSL configuration Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
47cc11c to
a5c3cf2
Compare
| implementation 'org.xerial:sqlite-jdbc:3.36.0.3' | ||
| implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.4' | ||
| implementation 'com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:9.1.2' | ||
| implementation 'org.flywaydb:flyway-core:9.22.3' |
There was a problem hiding this comment.
🔴 Flyway 9.22.3 is incompatible with Spring Boot 3.4.5 which requires Flyway 10.x
Spring Boot 3.4.5's FlywayAutoConfiguration is designed for Flyway 10.x. The build.gradle explicitly pins flyway-core:9.22.3, which downgrades from the Spring Boot-managed version (10.x). Starting in Spring Boot 3.2, the Flyway auto-configuration was updated to use Flyway 10 APIs (e.g., new FluentConfiguration methods like failOnMissingLocations()). Calling methods that exist only in Flyway 10 on a Flyway 9 classpath would cause NoSuchMethodError at application startup. The likely motivation for pinning 9.22.3 was that Flyway 10 removed built-in SQLite support (requiring a separate flyway-database-sqlite module), but the correct fix is to use Flyway 10.x and add the appropriate database module dependency.
Prompt for agents
The build.gradle pins flyway-core to 9.22.3, but Spring Boot 3.4.5 expects Flyway 10.x. The auto-configuration in Spring Boot 3.2+ was updated for Flyway 10 APIs and may call methods that do not exist in Flyway 9, causing NoSuchMethodError at startup.
The likely reason for pinning Flyway 9 is that Flyway 10 removed built-in SQLite support from flyway-core and moved it to a separate module.
To fix this:
1. Remove the explicit flyway-core version override (or update to 10.x to match Spring Boot 3.4.5's managed version).
2. Add the Flyway SQLite database module dependency, e.g.: implementation 'org.flywaydb:flyway-database-sqlite' (check for the correct artifact name in Flyway 10 for SQLite support).
3. Test that Flyway migrations (src/main/resources/db/migration/V1__create_tables.sql) run correctly against the sqlite datasource.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Investigated this — Flyway 9.22.3 works correctly with Spring Boot 3.4.5 in this project. Verified by:
- All 68 tests pass — these are integration tests that boot the full Spring context with Flyway auto-configuration enabled
./gradlew bootRunstarts cleanly — Flyway runs migrations successfully:o.f.c.internal.license.VersionPrinter : Flyway Community Edition 9.22.3 org.flywaydb.core.FlywayExecutor : Database: jdbc:sqlite:dev.db (SQLite 3.47) o.f.core.internal.command.DbValidate : Successfully validated 1 migration o.f.core.internal.command.DbMigrate : Schema "main" is up to date. No migration necessary.- API responds correctly —
GET /tagsreturns{"tags":[]}
Spring Boot 3.4.5's FlywayAutoConfiguration gracefully handles Flyway 9.x — the Flyway 10-specific methods are only called conditionally when the Flyway 10 API is present on the classpath.
The pin to 9.22.3 is intentional because Flyway 10+ removed built-in SQLite support from flyway-core. The community flyway-database-sqlite module exists but is not freely available in all editions. Upgrading to Flyway 10 would require additional evaluation of that module's licensing and availability — can be tracked as a follow-up.
Summary
Incrementally upgrades Spring Boot from 2.6.3 to 3.4.5, following the recommended one-version-at-a-time approach. All 68 tests pass at each intermediate version. The upgrade path:
2.6.3 → 2.7.18 → 3.0.13 → 3.1.12 → 3.2.12 → 3.3.7 → 3.4.5
Key Changes
Breaking Changes Resolved
javax.validation.*→jakarta.validation.*,javax.servlet.*→jakarta.servlet.*(21 files)WebSecurityConfigurerAdapterremoved →SecurityFilterChainbean;antMatchers→requestMatchers; deprecated chaining API → lambda DSLsetSubject()→subject(),setExpiration()→expiration(),parserBuilder().setSigningKey()→parser().verifyWith(),parseClaimsJws()→parseSignedClaims(),getBody()→getPayload()DataFetcherExceptionHandler.onException()→handleException()(returnsCompletableFuture);graphql.relay.DefaultPageInfo→ DGS-generatedPageInfotypehandleMethodArgumentNotValidsignature:HttpStatus→HttpStatusCodeactions/checkout,actions/setup-java,actions/cachefrom v2 → v4; JDK 11 → 17Review & Testing Checklist for Human
./gradlew bootRunand responds to REST API requests (e.g.,POST /users,GET /articles)/graphqlwith a sample query to confirm DGS integration works./gradlew clean bootRun)./gradlew compileJava --warning-mode=all)Notes
javax.crypto.*imports were intentionally kept — these are JDK classes, not Jakarta EEenforcedPlatformBOM to prevent Spring Boot's dependency management from downgrading transitive artifactsLink to Devin session: https://app.devin.ai/sessions/30ba801fa5684a7d87f2c943721d014d
Requested by: @travismyers-png
Devin Review