JinwooHwang opened a new pull request, #7968:
URL: https://github.com/apache/geode/pull/7968

   ### Problem
   Users depending on `geode-core` directly (without `geode-all-bom`) encounter 
`NoClassDefFoundError` for dependencies that are required at runtime but 
published with runtime scope. This affects users upgrading from 1.15.x to 2.0, 
particularly when:
   
   1. Loading disk stores from previous versions
   2. Creating OQL queries via `QueryService.newQuery()`
   
   ### Root Cause
   Two dependencies were declared as `implementation` (runtime scope in POM) 
but are actually used in public APIs and core initialization code:
   
   - **jopt-simple**: Used in `ServerLauncher`, `LocatorLauncher` (public APIs) 
and `AbstractDiskRegion` (persistence initialization)
   - **antlr**: Used in all query AST classes, loaded when compiling queries
   
   ### Solution
   Promote both dependencies from `implementation` to `api` scope, making them 
available at compile time for Maven/Gradle consumers.
   
   **Changes:**
   - `geode-core/build.gradle`: Change scope from `implementation` to `api`
   - `geode-core/src/test/resources/expected-pom.xml`: Update scope from 
`runtime` to `compile`
   
   ### Testing
   Verified generated POM contains correct compile scope:
   ```xml
   <dependency>
     <groupId>antlr</groupId>
     <artifactId>antlr</artifactId>
     <scope>compile</scope>
   </dependency>
   <dependency>
     <groupId>net.sf.jopt-simple</groupId>
     <artifactId>jopt-simple</artifactId>
     <scope>compile</scope>
   </dependency>
   ```
   
   ### Impact
   - Fixes `NoClassDefFoundError` for users not using `geode-all-bom`
   - No breaking changes - only makes dependencies more available
   - Aligns with actual API usage patterns
   
   Fixes issues reported by Leon Finker in RC2 testing feedback.
   
   
   <!-- Thank you for submitting a contribution to Apache Geode. -->
   
   <!-- In order to streamline review of your contribution we ask that you
   ensure you've taken the following steps. -->
   
   ### For all changes, please confirm:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in 
the commit message?
   - [x] Has your PR been rebased against the latest commit within the target 
branch (typically `develop`)?
   - [x] Is your initial contribution a single, squashed commit?
   - [ ] Does `gradlew build` run cleanly?
   - [ ] Have you written or updated unit tests to verify your changes?
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to