From 8346b00b0172c8e977e67126de43d9ab26f4ded4 Mon Sep 17 00:00:00 2001 From: Jinwoo Hwang Date: Fri, 24 Oct 2025 21:34:21 -0400 Subject: [PATCH] Fix Swagger annotation warnings in geode-dunit compilation Add io.swagger.core.v3:swagger-annotations dependency to geode-dunit's compile classpath to resolve compilation warnings about missing AccessMode enum constant. Problem: The geode-dunit module's compilation was generating warnings: warning: unknown enum constant AccessMode.READ_ONLY reason: class file for io.swagger.v3.oas.annotations.media.Schema$AccessMode not found Root Cause: The geode-dunit code references Swagger/OpenAPI annotations (such as @Schema with AccessMode) through transitive dependencies from geode-core and geode-gfsh, both of which have swagger-annotations as implementation dependencies. However, the Swagger annotations API was not explicitly declared as a compile-time dependency for geode-dunit. This caused the Java annotation processor to be unable to resolve the AccessMode enum during compilation. Solution: Added 'io.swagger.core.v3:swagger-annotations' to compileOnly configuration in geode-dunit/build.gradle. This ensures the Swagger annotations API is available during compilation, allowing the annotation processor to properly resolve Swagger/OpenAPI annotations. The compileOnly scope is appropriate here since: - Swagger annotations API is only needed at compile time for annotation processing - Runtime implementation is provided by transitive dependencies from geode-core and geode-gfsh - Keeps the classpath minimal and avoids duplicate dependencies - Consistent with patterns in geode-management and geode-deployment-legacy Testing: Verified with: ./gradlew :geode-dunit:compileJava Build completes successfully without Swagger annotation warnings. Related modules using similar pattern: - geode-core: has swagger-annotations in implementation scope - geode-gfsh: has swagger-annotations in implementation scope - geode-management: has swagger-annotations in testCompileOnly scope - geode-deployment-legacy: has swagger-annotations in compileOnly scope - geode-assembly: has swagger-annotations in various test scopes --- geode-dunit/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/geode-dunit/build.gradle b/geode-dunit/build.gradle index 50ddbfc59d90..06ae5cc865e8 100755 --- a/geode-dunit/build.gradle +++ b/geode-dunit/build.gradle @@ -22,6 +22,7 @@ plugins { dependencies { api(platform(project(':boms:geode-all-bom'))) + compileOnly('io.swagger.core.v3:swagger-annotations') implementation(project(':geode-logging')) implementation(project(':geode-serialization')) implementation(project(':geode-membership'))