[
https://issues.apache.org/jira/browse/GEODE-10530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18043737#comment-18043737
]
ASF GitHub Bot commented on GEODE-10530:
----------------------------------------
JinwooHwang commented on code in PR #117:
URL: https://github.com/apache/geode-examples/pull/117#discussion_r2600900899
##########
.github/workflows/gradle.yml:
##########
@@ -40,8 +40,8 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.distribution }}
- java-version: '8'
+ java-version: '17'
- name: Run All
uses: gradle/gradle-build-action@v2
with:
- arguments: runAll --console=plain --no-daemon
\ No newline at end of file
+ arguments: runAll
-PgeodeRepositoryUrl=https://repository.apache.org/content/repositories/orgapachegeode-1146
--console=plain --no-daemon
Review Comment:
Yes, exactly.
> Migrate Apache Geode Examples to Gradle 7.3.3 and Java 17
> ---------------------------------------------------------
>
> Key: GEODE-10530
> URL: https://issues.apache.org/jira/browse/GEODE-10530
> Project: Geode
> Issue Type: Improvement
> Reporter: Jinwoo Hwang
> Assignee: Jinwoo Hwang
> Priority: Major
>
> h2. Summary
> The Apache Geode Examples project currently uses outdated build tools and
> dependencies:
> * Gradle 5.5
> * Java 8
> This task is to migrate the project to modern versions to improve
> compatibility, security, and maintainability.
> h2. Goals
> * Upgrade Gradle from 5.5 to 7.3.3
> * Upgrade Java compatibility from Java 8 to Java 17
> * Ensure all builds and tests pass successfully
> * Maintain backward compatibility where possible
> h2. Current State
> h3. Build Configuration
> * *Gradle Version:* 5.5
> * *Java Version:* 8
> * *Repository:* {{[https://maven.apachegeode-ci.info/snapshots]}}
> h3. Key Dependencies
> * {{geode-all-bom}} - Platform BOM for dependency management
> * {{{}geode-core{}}}, {{{}geode-cq{}}}, {{geode-logging}} - Core Geode
> libraries
> * {{geode-lucene}} - Lucene integration (version 6.4.1)
> * Various Apache Commons and Guava dependencies
> h3. Known Issues
> * CI snapshot repository may have availability issues
> * Some Gradle configurations use deprecated syntax (e.g., {{{}compile{}}},
> {{{}baseName{}}})
> * Spotless plugin version incompatible with Gradle 7+
> * Legacy dependency declarations need modernization
> h2. Migration Scope
> h3. Files Requiring Updates
> ||File||Changes Required||
> |{{gradle/wrapper/gradle-wrapper.properties}}|Update Gradle distribution URL
> to 7.3.3|
> |{{sessionState/webapp/gradle/wrapper/gradle-wrapper.properties}}|Update
> Gradle distribution URL to 7.3.3|
> |{{build.gradle}}|Update plugin versions, fix deprecated syntax, add Java 17
> compatibility|
> |{{gradle/spotless.gradle}}|Update plugin reference and API usage|
> |{{gradle/release.gradle}}|Fix deprecated {{baseName}} property|
> |{{lucene/build.gradle}}|Replace {{compile}} with {{implementation}}|
> |{{luceneSpatial/build.gradle}}|Replace {{{}compile{}}}, update Lucene
> dependencies, fix {{configurations['runtime']}}|
> |{{micrometerMetrics/build.gradle}}|Fix
> {{configurations.compile.extendsFrom}}|
> |{{sessionState/webapp/build.gradle}}|Replace {{{}providedCompile{}}},
> {{{}testCompile{}}}, update Java version|
> |{{gradle.properties}}|Update Geode version and repository URL|
> |{{.github/workflows/gradle.yml}}|Update Java version in CI workflow|
> h3. Plugin Updates
> * {{{}org.nosphere.apache.rat{}}}: 0.6.0 → 0.8.0
> * {{{}com.diffplug.gradle.spotless{}}}: 3.0.0 → {{com.diffplug.spotless}}
> 6.11.0
> * {{{}de.undercouch.download{}}}: 3.1.2 → 5.0.1
> h3. API/Syntax Changes
> h4. Gradle 7 Deprecations
> * {{compile}} → {{implementation}}
> * {{testCompile}} → {{testImplementation}}
> * {{providedCompile}} → {{compileOnly}}
> * {{configurations['runtime']}} → {{configurations.runtimeClasspath}}
> * {{configurations.compile.extendsFrom()}} → {{implementation
> configurations.xxx}}
> * {{baseName}} → {{archiveBaseName}}
> * {{extension}} → {{archiveExtension}}
> * {{archiveName}} → {{archiveFileName}}
> h4. Spotless Plugin
> * Plugin ID: {{com.diffplug.gradle.spotless}} → {{com.diffplug.spotless}}
> * {{eclipseFormatFile()}} → {{eclipse().configFile()}}
> h2. Migration Strategy
> h3. Phase 1: Investigation & Planning (Day 1)
> * Research Gradle 7.3.3 migration requirements and breaking changes
> * Identify all deprecated API usages across the project
> * Review Lucene version compatibility matrix
> * Create detailed task breakdown and risk assessment
> h3. Phase 2: Gradle Wrapper & Build Script Updates (Days 2-3)
> * Update {{gradle-wrapper.properties}} files to Gradle 7.3.3
> * Update plugin versions in root {{build.gradle}}
> * Fix deprecated Gradle API usage across all build scripts
> * Update dependency configurations (compile → implementation, etc.)
> * Add Java 17 sourceCompatibility and targetCompatibility
> * Test wrapper functionality and basic build execution
> h3. Phase 3: Dependency Resolution & Repository Configuration (Days 4-5)
> * Implement flexible repository URL configuration via parameters
> * Resolve Lucene dependency conflicts
> * Add missing transitive dependencies (e.g., spatial4j)
> * Update dependency versions for Java 17 compatibility
> * Test dependency resolution with various repository configurations
> h3. Phase 4: Code Compatibility & API Updates (Days 6-7)
> * Address Java 17 compilation issues
> * Update Lucene API usage for version 9+ compatibility
> ** Replace {{RAMDirectory}} with {{ByteBuffersDirectory}}
> ** Update {{totalHits}} to {{totalHits.value}}
> ** Fix other Lucene API changes
> * Resolve deprecated API warnings
> * Update test code for new library versions
> * Fix any code that relies on JDK internal APIs
> h3. Phase 5: Testing & Issue Resolution (Days 8-9)
> * Run full build with {{./gradlew clean build}}
> * Execute all tests and identify failures
> * Debug and fix test failures
> * Run spotless formatting checks
> * Test with both hardcoded and parameterized repository URLs
> * Verify all subprojects compile and test successfully
> * Run integration tests if available
> h3. Phase 6: CI/CD & Documentation (Day 10)
> * Update GitHub Actions workflow for Java 17
> * Update README with new build requirements
> * Document new command-line parameter usage
> * Create migration guide for developers
> * Update contribution guidelines if needed
> * Test CI pipeline end-to-end
> h2. Risks & Mitigation
> h3. Breaking API Changes
> *Risk:* Lucene API changes between versions 6.4.1 and 9.12.3
> *Mitigation:*
> * Research Lucene migration guide thoroughly
> * Update code to use new APIs (e.g., {{RAMDirectory}} →
> {{{}ByteBuffersDirectory{}}})
> * Fix {{totalHits}} → {{totalHits.value}} in test assertions
> * Allocate extra time for API compatibility testing
> * Consider maintaining compatibility layer if needed
> h3. Gradle Plugin Compatibility
> *Risk:* Older plugin versions incompatible with Gradle 7.3.3
> *Mitigation:*
> * Update all plugins to versions compatible with Gradle 7.x
> * Test plugin functionality after upgrade
> * Review plugin documentation for breaking changes
> * Have rollback plan if plugins don't work
> h3. Test Failures
> *Risk:* Tests may fail due to dependency version changes or API
> incompatibilities
> *Mitigation:*
> * Run tests frequently during migration
> * Fix issues incrementally
> * Add missing dependencies (e.g., {{{}spatial4j{}}})
> * Allocate dedicated time for debugging test failures
> * Document known issues and workarounds
> h3. Java 17 Compatibility
> *Risk:* Code may use deprecated or removed Java APIs
> *Mitigation:*
> * Run with {{--illegal-access=warn}} to identify issues early
> * Update code to use supported APIs
> * Test thoroughly on Java 17 runtime
> * Review Java 17 migration guide
> h2. Success Criteria
> # Gradle 7.3.3 wrapper successfully downloads and executes
> # Java 17 sourceCompatibility and targetCompatibility set
> # All deprecated Gradle configurations replaced
> # {{/gradlew build}} completes successfully
> # {{/gradlew test}} passes with zero failures
> # {{/gradlew spotlessApply}} executes without errors
> # Repository URL can be specified via {{-P}} parameter
> # CI workflow updated to use Java 17 and passes
> # No compilation warnings related to deprecated APIs (target)
> # Documentation updated with new build requirements
> # All subprojects build and test successfully
> # Code formatting standards maintained
> h2. Dependencies
> * Gradle 7.3.3 compatible plugins
> * Java 17 JDK installed on development and CI environments
> * Updated Lucene spatial dependencies
> * Coordination with Geode release team for repository access
> * Testing environment with Java 17 runtime
> h2. Timeline Estimate
> ||Phase||Estimated Effort||
> |Phase 1: Investigation & Planning|1 day|
> |Phase 2: Gradle & Build Scripts|2 days|
> |Phase 3: Dependencies & Repositories|2 days|
> |Phase 4: Code Compatibility|2 days|
> |Phase 5: Testing & Issue Resolution|2 days|
> |Phase 6: CI/CD & Documentation|1 day|
> |*Buffer for unexpected issues*|*2 days*|
> |*Total*|*12 days*|
> _Note: Timeline assumes one developer working full-time. Actual duration may
> vary based on complexity of issues encountered and availability of external
> dependencies._
> h2. References
> * [Gradle 7.3.3 Release
> Notes|https://docs.gradle.org/7.3.3/release-notes.html]
> * [Gradle 7.x Migration
> Guide|https://docs.gradle.org/current/userguide/upgrading_version_6.html]
> * [Java 17 Migration
> Guide|https://docs.oracle.com/en/java/javase/17/migrate/]
> * [Lucene 9.x Migration Guide|https://lucene.apache.org/core/9_0_0/]
> * [Gradle Java Plugin
> Documentation|https://docs.gradle.org/current/userguide/java_plugin.html]
> * [Spotless Plugin Documentation|https://github.com/diffplug/spotless]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)