gpt4 book ai didi

gradle - 如何在gradle kotlin dsl上配置jsonschema2pojo插件

转载 作者:行者123 更新时间:2023-12-03 03:17:16 24 4
gpt4 key购买 nike

我在我的kotlin dsl jsonschema2pojo文件中使用build gradle插件。
现在,我需要按照here所述更改插件的默认配置

    jsonSchema2Pojo {
source = files("${sourceSets.main.output.resourcesDir}/json")
}
当我添加此时,我得到以下错误-

$ gradle generateJsonSchema2Pojo

Configure project :e: /Users/rajkumar.natarajan/Documents/Coding/misc/jsonschema2pojo-enum-demo/build.gradle.kts:20:1: Unresolved reference: jsonSchema2Pojoe: /Users/rajkumar.natarajan/Documents/Coding/misc/jsonschema2pojo-enum-demo/build.gradle.kts:21:3: Unresolved reference: sourcee: /Users/rajkumar.natarajan/Documents/Coding/misc/jsonschema2pojo-enum-demo/build.gradle.kts:21:21: Unresolved reference: sourceSets

FAILURE: Build failed with an exception.

  • Where:Build file '/Users/rajkumar.natarajan/Documents/Coding/misc/jsonschema2pojo-enum-demo/build.gradle.kts' line: 20

  • What went wrong:Script compilation errors:

Line 20: jsonSchema2Pojo {^ Unresolved reference: jsonSchema2Pojo

Line 21: source = files("${sourceSets.main.output.resourcesDir}/json")^ Unresolved reference: source

Line 21: source = files("${sourceSets.main.output.resourcesDir}/json")^ Unresolved reference: sourceSets

3 errors


我的构建文件在github here上。
任何想法如何为jsonschema2pojo插件配置我的构建文件?

最佳答案

尝试在gradle.build.kts中使用这种配置

configure <org.jsonschema2pojo.gradle.JsonSchemaExtension> {
dateTimeType = "java.time.ZonedDateTime"
includeAdditionalProperties = false
includeConstructors = true

// etc.
}

关于gradle - 如何在gradle kotlin dsl上配置jsonschema2pojo插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59776834/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com