OpenAPITools / OpenAPITools/openapi-generator

[BUG] [JAVA] [MicroProfile] Only maven's pom.xml is generated, nothing for gradle (or SBT)

Open
#17,908 2 comments 0 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

Description

When generating with library = "microprofile", only the pom.xml file is generated, the build.gradle is nowhere to be found.
This seems to be by design (it also means that those blocks are useless for microprofile), but that sounds like an issue. I cannot use the generated code directly and it seems I need to maintain a build.gradle with dependencies matching the ones in the pom.xml.

openapi-generator version

gradle plugin: 7.3.0

Generation Details
val generateJvm = task<org.openapitools.generator.gradle.plugin.tasks.GenerateTask>("generateJvm") {
    inputs.files(oas)
    generatorName = "java"
    library = "microprofile"
    inputSpec = oas.singleFile.absolutePath
    apiPackage = "com.client.api"
    modelPackage = "com.model"
    outputDir.set("${layout.buildDirectory.asFile.get().absolutePath}/generated")
    configOptions = mapOf(
        "serializationLibrary" to "jackson",
        "useJakartaEe" to "true"
    )
    skipValidateSpec = true
}

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 in JavaClientCodegen.java at the referenced lines around 562, 568, and 686, then reproduce generation with library="microprofile" and the shown Gradle configuration. Trace why only pom.xml is emitted and define the generated Gradle output and dependencies so the MicroProfile client can be used directly alongside Maven output.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.