From e6e4fef4ea22f6b569e2c969f410f817c0c3203e Mon Sep 17 00:00:00 2001 From: Jinwoo Hwang Date: Wed, 10 Dec 2025 20:33:53 -0500 Subject: [PATCH] Promote jopt-simple and antlr to api scope 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 --- geode-core/build.gradle | 11 +++++++---- geode-core/src/test/resources/expected-pom.xml | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/geode-core/build.gradle b/geode-core/build.gradle index 5ffa6f7d125..a9fef9195f3 100755 --- a/geode-core/build.gradle +++ b/geode-core/build.gradle @@ -178,6 +178,8 @@ dependencies { // The antlr configuration is used by the antlr plugin, which compiles grammar // files used by the query engine antlr 'antlr:antlr' + // antlr is also needed at compile scope because it's used in public query API classes + api('antlr:antlr') // External //------------------------------------------------------------ @@ -214,8 +216,8 @@ dependencies { //Jgroups is a core component of our membership system. implementation('org.jgroups:jgroups') - //Antlr is used by the query engine. - implementation('antlr:antlr') + //Antlr is used by the query engine and its objects end up in public API (query AST classes). + api('antlr:antlr') //Jackson annotations is used in gfsh implementation('com.fasterxml.jackson.core:jackson-annotations') @@ -296,8 +298,9 @@ dependencies { implementation('net.java.dev.jna:jna') implementation('net.java.dev.jna:jna-platform') - //JOptSimple is used by gfsh. A couple of usages have leaked into DiskStore - implementation('net.sf.jopt-simple:jopt-simple') + //JOptSimple is used by gfsh and in public API classes (ServerLauncher, LocatorLauncher) + //and core persistence code (AbstractDiskRegion, DiskRegion) + api('net.sf.jopt-simple:jopt-simple') //Log4j is used everywhere implementation('org.apache.logging.log4j:log4j-api') diff --git a/geode-core/src/test/resources/expected-pom.xml b/geode-core/src/test/resources/expected-pom.xml index 4b0caecf260..513b4dff504 100644 --- a/geode-core/src/test/resources/expected-pom.xml +++ b/geode-core/src/test/resources/expected-pom.xml @@ -247,7 +247,7 @@ net.sf.jopt-simple jopt-simple - runtime + compile log4j-to-slf4j