Skip to content

Upgrade to Java 21 and Spring Boot 3.2.12#201

Open
ninhomilton wants to merge 11 commits intomainfrom
UpgradeJava21
Open

Upgrade to Java 21 and Spring Boot 3.2.12#201
ninhomilton wants to merge 11 commits intomainfrom
UpgradeJava21

Conversation

@ninhomilton
Copy link
Copy Markdown
Collaborator

Upgrade to Java 21 and Spring Boot 3.2.12

  • Upgrades the entire project from Java 11 to Java 21 and Spring Boot 2.x to 3.2.12 across all 7 modules
  • Updates GitHub Actions workflows (build.yml, main.yml, release.yml) to use java-version: 21
  • Fixes test compatibility issues: truncates LocalDateTime to microseconds in repository tests to match MySQL precision
  • Migrates Spring/Hibernate imports and configs for Spring Boot 3 compatibility (e.g. MySQLDialect, JPA config updates)
  • Upgrades spotbugs-maven-plugin to 4.8.6.6 and other dependencies for Java 21 compatibility

ninhomilton and others added 11 commits March 18, 2026 17:18
- Bump Java source/target/release to 21 across all modules
- Upgrade Spring Boot from 2.7.9 to 3.2.12
- Migrate javax.* to jakarta.* (persistence, servlet, annotation)
- Add CrudRepository to repository interfaces (Spring Data 3.x breaking change)
- Update springdoc-openapi from 1.x to 2.x (GroupedOpenApi, ParameterObject)
- Fix Testcontainers LocalStack API: getEndpointOverride() replaces getEndpointConfiguration()
- Fix Awaitility 4.x: replace org.awaitility.Duration with java.time.Duration
- Fix Hadoop+Java21: disable FileSystem cache to avoid UserGroupInformation incompatibility
- Add JVM --add-opens flags for Hadoop/reflection compatibility in tests
- Exclude JPA auto-configuration from @WebMvcTest context in API tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace JUnit 4 @rule with @container on LocalStack S3 containers in
  BeekeeperMetadataCleanupIntegrationTest and BeekeeperDryRunMetadataCleanupIntegrationTest
  to fix ExceptionInInitializerError caused by static block running before Testcontainers start
- Add properties.sqs.endpoint and properties.sqs.region Spring properties to
  CommonBeans.messageReader() so the SqsMessageReader uses a custom AmazonSQS client
  with explicit LocalStack endpoint and matching region (us-west-2), fixing
  QueueDoesNotExistException caused by LocalStack's region-sensitive SQS queue lookup
- Set properties.sqs.region in BeekeeperUnreferencedPathSchedulerApiaryIntegrationTest
  and BeekeeperExpiredMetadataSchedulerApiaryIntegrationTest to match the region used
  when creating SQS queues in LocalStack
- Apply Spotless formatting to all changed integration test files

All 71 integration tests now pass (1 skipped, pre-existing).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- PagingMetadataCleanupServiceTest: fix ArgumentCaptor type from
  HousekeepingPath to HousekeepingEntity to match the actual type
  passed to PathCleaner.cleanupPath(HousekeepingEntity)
- CommonBeans (path-cleanup): remove spurious withPathStyleAccessEnabled(true)
  from amazonS3Test() which caused URL host to be "endpoint" instead of
  "bucket.endpoint" as the test expected

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After Java 21 / Spring Boot 3.2.12 upgrade, LocalDateTime.now() produces
nanosecond-precision timestamps but H2 (MySQL mode) stores DATETIME with
microsecond precision, causing round-trip comparison failures and incorrect
query boundary evaluations. Truncate CREATION_TIMESTAMP and compare() helper
to MICROS to align in-memory values with DB-stored values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… test

Same nanosecond vs microsecond precision issue as in beekeeper-core tests.
H2 (MySQL mode) truncates DATETIME to microseconds, causing the cleanupTimestamp
round-trip comparison to fail after Java 21 upgrade.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SpotBugs 4.0.4 (inherited from eg-oss-parent) uses an outdated ASM library
that cannot parse Java 21 class files (major version 65), causing the CI
build to fail with NoClassesFoundToAnalyzeException. Overriding
maven.spotbugs.plugin.version to 4.8.6.6 resolves the issue.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant