OpenAPITools / OpenAPITools/openapi-generator

[BUG] Gradle 6.8 complains about outputDir property to be deprecated

Open
#8,591 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

This generate call done with gradle 6.8 and openapi-generator 5.0.0:

gradlew --warning-mode=all build

causes the following deprecation warning:

Querying the mapped value of task ':xxx:xxx:openApiGenerate' property 'outputDir' before task ':xxx:xxx:openApiGenerate' has completed has been deprecated. This will fail with an error in Gr
adle 7.0. Consult the upgrading guide for further information: https://docs.gradle.org/6.8/userguide/upgrading_version_6.html#querying_a_mapped_output_property_of_a_task_before_the_task_has_completed

This is the generate config for build.gradle

openApiGenerate {
    generatorName = "java"
    library = "resttemplate"
    inputSpec = "${projectDir}/src/main/swagger/Example.yaml"
    outputDir = "${projectDir}/src/generated/"
    apiPackage = "adapter.web.api"
    modelPackage = "adapter.web.model"
    generateApiDocumentation = false
    generateApiTests = false
    configOptions["java8"] = "true"
    configOptions["dateLibrary"] = "java8"
    globalProperties["models"] = ""
}

Currently the ist no way to avoid this message.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the openApiGenerate configuration in build.gradle and reproduce the warning using gradlew --warning-mode=all build with Gradle 6.8. Trace how outputDir is queried before the task completes, then verify that the deprecation warning is resolved and the generation configuration remains compatible with Gradle 7.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.