Skip to content

Conversation

@JinwooHwang
Copy link
Contributor

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:

<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.

For all changes, please confirm:

  • Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
  • Has your PR been rebased against the latest commit within the target branch (typically develop)?
  • 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?

These dependencies are used in public API classes and need to be
available at compile time for consumers of geode-core.

- jopt-simple: Used in ServerLauncher and LocatorLauncher (public APIs)
  and AbstractDiskRegion (loaded during cache initialization)
- antlr: Used in all query AST classes, required when creating queries
  via QueryService.newQuery()

This fixes NoClassDefFoundError exceptions when users depend on
geode-core directly without using geode-all-bom, particularly when:
1. Loading disk stores from previous versions
2. Creating OQL queries
@JinwooHwang
Copy link
Contributor Author

Hi @sboorlagadda
All checks have passed. We would greatly appreciate it if you could review this PR, which was identified during 2.0.0.RC2 testing by @leonfin.

@JinwooHwang
Copy link
Contributor Author

Hi @leonfin, thank you for reporting these issues. Please let me know if this resolves them.

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.

1 participant