Commit a0842c1
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 scopes1 parent bbc1924 commit a0842c1
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
0 commit comments