Gradlev7.0+OpenApiGeneratorGradle插件关于可变类型的错误

我目前正在使用 OpenApiGenerator 插件更新 gradle 项目。我更新了 gradle 版本 (v7.0) 和 OpenApiGenerator 插件版本 (5.1.0)。

当我尝试构建时,我收到这条奇怪的消息:

Some problems were found with the configuration of task ':api:openApiValidate' (type 'ValidateTask').
  - Type 'ValidateTask' property 'inputSpec' of mutable type 'org.gradle.api.provider.Property' is writable.

这是脚本:

apply plugin: 'org.openapi.generator'

description = """OpenApi API Validator"""

def openApiInput = file(tasks.getByName('processResources').outputs.files.singleFile.absolutePath + "openapi.yml")

openApiValidate {
    inputSpec = openApiInput.path
}

tasks.findByName('openApiValidate').inputs.files openApiInput
tasks.findByName('openApiValidate').outputs.dir project.buildDir
tasks.findByName('openApiValidate').dependsOn 'processResources'
classes.dependsOn 'openApiValidate'

tasks.findByName('openApiGenerate').enabled = false

知道如何解决这个问题吗?谢谢!

以上是Gradlev7.0+OpenApiGeneratorGradle插件关于可变类型的错误的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>