Skip to content

Conversation

@callummiles
Copy link
Owner

Upgrade Spring Boot from 2.2.0.M6 to 2.7.18

Summary

This PR upgrades the project from Spring Boot 2.2.0.M6 (milestone/pre-release) to 2.7.18 (stable release), as a prerequisite for eventually upgrading to Java 17. All automated tests pass (181 unit tests + 22 integration tests).

Key Changes:

  • Updated Spring Boot parent version to 2.7.18
  • Removed snapshot/milestone repositories (no longer needed for stable releases)
  • Updated all dependencies to compatible versions (Lombok, H2, Vavr, Spock, Groovy)
  • Updated Maven plugins (Surefire, Failsafe, GMaven Plus)
  • Added H2 MODE=LEGACY for backward compatibility with H2 1.x SQL syntax
  • Updated Spring HATEOAS API usage to use static factory methods instead of constructors

Review & Testing Checklist for Human

This is a major framework upgrade. While all automated tests pass, manual verification is recommended:

  • Start application locally: Run mvn spring-boot:run -Dspring-boot.run.profiles=dev and verify it starts without errors
  • Test REST endpoints: Manually test a few REST API endpoints (e.g., /profiles/{patronId}/holds/) to ensure HATEOAS links are generated correctly
  • Check for deprecation warnings: Review application logs for any deprecation warnings from Spring Boot 2.7.x
  • Verify database operations: Test that database reads/writes work correctly with H2 2.x in LEGACY mode
  • Long-term H2 strategy: Consider whether MODE=LEGACY is acceptable long-term, or if SQL scripts should be migrated to native H2 2.x syntax (this PR uses MODE=LEGACY as a compatibility workaround)

Test Plan

  1. Start the application with the dev profile
  2. Access health endpoint: http://localhost:8080/actuator/health
  3. Test a few REST endpoints to verify HATEOAS functionality
  4. Check H2 console if needed: http://localhost:8080/h2-console

Notes

Spring HATEOAS API Changes: Updated PatronProfileController to use CollectionModel.of() and EntityModel.of() instead of constructors (4 locations updated). These were the only occurrences found, but please verify.

H2 Database Compatibility: Used MODE=LEGACY in database URLs to maintain compatibility with H2 1.x SQL syntax. The SQL scripts use older syntax like INTEGER IDENTITY which would otherwise fail in H2 2.x. A future improvement would be migrating these scripts to H2 2.x native syntax.

Test Results: All tests pass locally:

  • 181 unit tests: 0 failures
  • 22 integration tests: 0 failures
  • Build time: ~25 seconds

Link to Devin run: https://app.devin.ai/sessions/3b7e3bb90cfd43b48642a7299f2e7966
Requested by: @callummiles

- Update Spring Boot parent version to 2.7.18
- Remove spring-hateoas.version property (managed by Spring Boot)
- Remove snapshot and milestone repositories
- Update dependencies:
  - Lombok: 1.18.4 → 1.18.30
  - H2: 1.4.197 → 2.2.224
  - Vavr: 0.9.2 → 0.10.4
  - Spock: 1.2-groovy-2.5 → 2.3-groovy-3.0
  - Add Groovy 3.0.19 for Spock compatibility
- Update plugins:
  - GMaven Plus: 1.6.2 → 3.0.2
  - Surefire: 2.20 → 2.22.2
  - Failsafe: 2.22.1 → 2.22.2
- Add MODE=LEGACY to H2 database URLs for backward compatibility
- Update Spring HATEOAS API usage (CollectionModel.of/EntityModel.of)
- Configure embedded databases with unique names and MODE=LEGACY

All 181 unit tests and 22 integration tests pass successfully.

Co-Authored-By: Callum Miles <cwmiles18@gmail.com>
@devin-ai-integration
Copy link

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

2 participants