Skip to content

Commit a0842c1

Browse files
authored
Fix Swagger annotation warnings in geode-dunit compilation (#7948)
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
1 parent bbc1924 commit a0842c1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

geode-dunit/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ plugins {
2222

2323
dependencies {
2424
api(platform(project(':boms:geode-all-bom')))
25+
compileOnly('io.swagger.core.v3:swagger-annotations')
2526
implementation(project(':geode-logging'))
2627
implementation(project(':geode-serialization'))
2728
implementation(project(':geode-membership'))

0 commit comments

Comments
 (0)