Skip to content

[BUG] Java gradle.properties #21123

@Treenity

Description

@Treenity
Description

When generating java client, it seem its not possible to use gradleProperties to set gradle.properties values.
tries with java.yaml config file, and directly as argument using CLI, nothing work

the generated gradle.properties is EMPTY.
using the openapi-generator-cli author template -g java -o ./templates/java and editing the gradle.properties templates, specifying this directory in my CLI command does not change anything

I'm actually using the npm library on a OSX environement

openapi-generator version

@openapitools/openapi-generator-cli : 2.19.1

OpenAPI declaration file content or url
generatorName: java
additionalProperties:
  library: native
  dateLibrary: java8-localdatetime
  developerName: MyName
  developerEmail: "support@MyCompany.fr"
  developerOrganization: MyCompany
  developerOrganizationUrl: "https://MyCompany.fr"
  annotationLibrary: "swagger2"
  hideGenerationTimestamp: "true"
  gradleProperties:
    - "spotless_java_formatter=../format/eclipse-java-formatter-1.0.0.xml"
    - "spotless_java_importorder=../format/eclipse-java-importorder-1.0.0.importorder"
    - "spotless_gradle_formatter=../format/eclipse-groovy-formatter-1.0.0.properties"
Generation Details

using preview config file and a swagger.json i use:
openapi-generator-cli generate -i ./dist/swagger.json -g java -o dist/clients/petstore-core-sdk-client-java -c ./src/configs/java.yaml

Client is generated using most of the yaml settings, except gradleProperties which remain empty.

Steps to reproduce
  1. use the previous yaml, or use the gradleProperties directly from the CLI
  2. generate the client using, as example: openapi-generator-cli generate -i ./dist/swagger.json -g java -o dist/clients/petstore-core-sdk-client-java -c ./src/configs/java.yaml
  3. look for dist/clients/petstore-core-sdk-client-java/gradle.properties content
  4. it's empty, it must contain the gradleProperties array from the yaml, 1 item per line
Suggest a fix

I dont know how to fix it actually, but maybe it could be a nice idea to add it to the tests

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions