【问题标题】:Update to Gradle 7.3, Java 17更新到 Gradle 7.3、Java 17
【发布时间】: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


【解决方案1】:

我解决了这个错误

如果你需要解决这个问题,你应该检查你的:

  • 龙目岛版
  • 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 属性中

【讨论】:

    猜你喜欢
    • 2022-08-22
    • 2016-08-22
    • 2017-01-10
    • 2022-06-13
    • 2018-09-22
    • 2022-01-02
    • 2021-10-24
    • 1970-01-01
    • 2015-04-11
    相关资源
    最近更新 更多