【发布时间】:2022-01-30 11:17:17
【问题描述】:
我想将 gradle 从 5.6 更新到 7.3,但我做不到。我在编译项目期间遇到了这个问题(我有 java 17)。我读到 gradle >7 版本有一些问题,也许你知道出了什么问题?谢谢回复
这是使用 gradle 7.3 编译项目后的日志:
Some problems were found with the configuration of task ':api:TemplateServices-api:generateSwaggerCodeDocs' (type 'GenerateSwaggerCode').
- In plugin 'org.hidetake.swagger.generator' type 'org.hidetake.gradle.swagger.generator.GenerateSwaggerCode' property 'adaptorFactory' is missing an input or output annotation.
Reason: A property without annotation isn't considered during up-to-date checking.
Possible solutions:
1. Add an input or output annotation.
2. Mark it as @Internal.
Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#missing_annotation for more details about this problem.
- In plugin 'org.hidetake.swagger.generator' type 'org.hidetake.gradle.swagger.generator.GenerateSwaggerCode' property 'configFile' is annotated with @InputFile but missing a normalization strategy.
Reason: If you don't declare the normalization, outputs can't be re-used between machines or locations on the same machine, therefore caching efficiency drops significantly.
Possible solution: Declare the normalization strategy by annotating the property with either @PathSensitive, @Classpath or @CompileClasspath.
Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#missing_normalization_annotation for more details about this problem.
- In plugin 'org.hidetake.swagger.generator' type 'org.hidetake.gradle.swagger.generator.GenerateSwaggerCode' property 'wipeOutputDir' of type boolean shouldn't be annotated with @Optional.
Reason: Properties of primitive type cannot be optional.```
【问题讨论】:
-
您使用的是哪个版本的
org.hidetake.swagger.generator插件?插件 (github.com/int128/gradle-swagger-generator-plugin/issues/185) 有一个错误报告,其中提到如果没有修复插件将在 Gradle 7.x 中失败 - 但该错误已在org.hidetake.swagger.generator插件版本 2.18.2 中修复(在评论时) 2.19.2版本是最新版本) -
@ThomasKläger 我将版本更改为 2.19.2 但我一直遇到 gradle 问题...我粘贴在错误下方
标签: java spring gradle swagger