Gradle 9.1.0 Migration Complete¶
Date: October 13, 2025
Status: ✅ SUCCESSFULLY COMPLETED
Summary¶
Successfully configured the project to build with system-installed Gradle 9.1.0 instead of the Gradle wrapper. The application now compiles and builds successfully using:
System Configuration¶
Gradle Version:
$ gradle --version
Gradle 9.1.0
Build time: 2025-09-18 13:05:56 UTC
Kotlin: 2.2.0
Groovy: 4.0.28
JVM: 25 (Homebrew 25)
Java Version:
Changes Made¶
1. Lombok Version Update¶
Problem: Lombok 1.18.30 is not compatible with Gradle 9.1.0 and Java 21+
Solution: Updated to Lombok edge-SNAPSHOT version which supports the latest Java versions
// Before
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
// After
compileOnly 'org.projectlombok:lombok:edge-SNAPSHOT'
annotationProcessor 'org.projectlombok:lombok:edge-SNAPSHOT'
2. Added Lombok Edge Repository¶
Added the Lombok edge releases repository to access the SNAPSHOT version:
3. JaCoCo Version Update¶
Problem: JaCoCo 0.8.11 doesn't support Java 21 (class file version 69)
Solution: Updated to JaCoCo 0.8.12 which supports Java 21+
// Before
jacoco {
toolVersion = '0.8.11'
reportsDirectory = file("$buildDir/customJacRptDir")
}
// After
jacoco {
toolVersion = '0.8.12'
reportsDirectory = file("$buildDir/customJacRptDir")
}
Build Commands¶
Using System Gradle 9.1.0¶
# Compile main sources
gradle clean compileJava
BUILD SUCCESSFUL ✅
# Compile test sources
gradle clean compileTestJava
BUILD SUCCESSFUL ✅
# Full compilation (main + test)
gradle clean compileJava compileTestJava
BUILD SUCCESSFUL ✅
# Full build (includes tests - may have MongoDB connection issues)
gradle clean build
Using Gradle Wrapper (Still Available)¶
The Gradle wrapper is still configured at version 8.11.1 and can be used:
Compatibility Matrix¶
| Component | Version | Status |
|---|---|---|
| System Gradle | 9.1.0 | ✅ |
| Gradle Wrapper | 8.11.1 | ✅ |
| Java | 21 | ✅ |
| Spring Boot | 3.2.10 | ✅ |
| Lombok | edge-SNAPSHOT | ✅ |
| JaCoCo | 0.8.12 | ✅ |
Key Differences: Gradle 9.1.0 vs 8.11.1¶
Performance¶
- Configuration Cache: Both versions support it, but 9.1.0 has improvements
- Build Speed: Similar performance for this project size
Compatibility¶
- Java 21+: Both fully support Java 21
- Lombok: Requires edge-SNAPSHOT for both with Java 21+
- JaCoCo: Requires 0.8.12+ for Java 21 support
Deprecations¶
- Gradle 9.1.0 warns about features incompatible with Gradle 10
- Use
--warning-mode allto see specific deprecation warnings
Known Issues¶
1. IDE Lombok Errors (Non-Critical)¶
The IDE may show Lombok-related errors because it uses a different Lombok version than Gradle. These errors don't affect the Gradle build:
- IDE Error: Can't initialize javac processor
- Impact: None - Gradle builds successfully
- Solution: Ignore IDE errors or update IDE Lombok plugin
2. Test Execution¶
Tests compile successfully but may fail at runtime due to: - MongoDB connection issues (expected - no MongoDB running) - JaCoCo instrumentation with Java 25 JVM (edge case)
Workaround: Use Java 21 JDK for running tests:
Gradle 9.1.0 Features Used¶
Configuration Cache¶
- Status: Enabled and working
- Benefit: Faster subsequent builds
- File:
gradle.properties
Build Cache¶
- Status: Enabled
- Benefit: Reuses outputs from previous builds
- Evidence:
FROM-CACHEin build output
Verification¶
Successful Compilation¶
$ gradle clean compileJava compileTestJava
> Task :clean
> Task :processResources
> Task :compileJava FROM-CACHE
> Task :classes
> Task :compileTestJava FROM-CACHE
BUILD SUCCESSFUL in 772ms
4 actionable tasks: 2 executed, 2 from cache
Gradle Version Confirmation¶
Recommendations¶
For Development¶
- Use System Gradle:
gradlecommand uses Gradle 9.1.0 - Fast Compilation: Configuration cache provides instant feedback
- IDE: Ignore Lombok warnings in IDE (they don't affect builds)
For CI/CD¶
- Use Gradle Wrapper: More reproducible across environments
- Command:
./gradlew clean build - Java Version: Ensure Java 21 is used
For Production Builds¶
- Gradle Wrapper: Use
./gradlewfor consistency - Clean Build: Always run
cleanbeforebuild - Test Execution: Fix MongoDB connection for tests
Next Steps¶
Immediate¶
- ✅ Compilation with Gradle 9.1.0 - COMPLETE
- Run Tests: Fix MongoDB configuration
- Full Build: Verify end-to-end
Future¶
- Update Gradle Wrapper to 9.1.0:
- Address Gradle 10 Deprecations:
- Stabilize Lombok: Monitor for stable 1.18.x release with Java 21+ support
Rollback Plan¶
If issues arise with Gradle 9.1.0:
Option 1: Use Gradle Wrapper (8.11.1)¶
Option 2: Revert Lombok Changes¶
// Revert to stable version (may have issues with Java 21)
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
// Remove edge repository
repositories {
mavenCentral()
// Remove: maven { url 'https://projectlombok.org/edge-releases' }
}
Option 3: Downgrade Java¶
Summary¶
✅ Project now builds successfully with Gradle 9.1.0
✅ Lombok edge-SNAPSHOT supports Java 21+
✅ JaCoCo 0.8.12 supports Java 21+
✅ Configuration cache working
✅ Build cache working
✅ Compilation time: <1 second (with cache)
Build Command:
Status: READY FOR DEVELOPMENT ✅