更新至 Gradle 7.3,Java 17
Update to Gradle 7.3, Java 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.springframework.boot:spring-boot-gradle-plugi版本
- 尝试添加 springfox-boot-starter 依赖项 (3.0.0)
- 检查版本 io.springfox:springfox-swagger
- org.openapitools:openapi-generator-gradle-plugin版本
- 检查 swagger 文件(.mustache 文件,gradle.build,版本)
- 尝试将 org.gradle.jvmargs=--add-opens=java.util=ALL-UNNAMED 添加到 gradle 属性
我想将 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.springframework.boot:spring-boot-gradle-plugi版本
- 尝试添加 springfox-boot-starter 依赖项 (3.0.0)
- 检查版本 io.springfox:springfox-swagger
- org.openapitools:openapi-generator-gradle-plugin版本
- 检查 swagger 文件(.mustache 文件,gradle.build,版本)
- 尝试将 org.gradle.jvmargs=--add-opens=java.util=ALL-UNNAMED 添加到 gradle 属性