Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG] Java generator "spring-boot" for server side stubs incompatible with Maven 3.10

Chiusa Adatta ai principianti
#25,202 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Karan-Rastogi ci sta già lavorando.

Dal 9/10/2026.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java, spring-boot
Ambito
build-system

Direzione di ricerca

La dipendenza duplicata deriva dal template di supporto pom.xml generato per la libreria spring-boot, quindi inizia cercando spring-boot-starter-restclient nelle risorse del generatore spring-boot Java. Conferma che compare sia nello scope compile sia nello scope test, poi rimuovi la copia con scope test. È completato quando il pom.xml generato la dichiara una sola volta e il progetto generato si compila con Maven 3.10 tramite mvn clean package.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Issue: Bug

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)

Description

Yesterday our pipelines using openapi generator CLI via docker images started failing. It turned out the underlying agents where updated to using Maven 3.10 (previously 3.9).

That change in Maven now treats certain duplicated dependencies in the POM as an error instead of just a warning being logged.

The error is related to org.springframework.boot:spring-boot-starter-restclient being duplicated in the Maven pom.xml compile and test scope. As needed for compile there is no need to redeclare for test also.

openapi-generator version

  • v7.26.0
  • no regression I'd say

OpenAPI declaration file content or url

not related to the OpenAPI schema itself, the respective generated Maven POM (support file?) is erronuous

Generation Details

  • using openapitools/openapi-generator-cli from Docker distribution
  • using the following config.yaml
artifactId: "whatever-server"
groupId: "my.org.system"
apiPackage: "my.org.system.whatever.server"
modelPackage: "my.org.system.whatever.server.model"
configPackage: "my.org.system.whatever.server"
library: "spring-boot"
artifactVersion: "0.0.10-20261009.t064033"
openApiNullable: "false"
modelPropertyNaming: "camelCase"
useSpringBoot4: "True"
useJackson3: "True"
useJakartaEe: "false"
interfaceOnly: "true"
delegatePattern: "false"
useResponseEntity: "false"
useBeanValidation: "true"
skipDefaultInterface: "true"
generateBuilders: "true"
generateApiTests: "false"
generateModelTests: "false"

Steps to reproduce

Just use the spring-boot Java generator and try to mvn clean package the outcome.
You will encounter a maven build error stating that spring-boot-starter-restclient is duplicated.

[ERROR]     'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.boot:spring-boot-starter-restclient:jar -> duplicate declaration of version (?) @ line 78, column 21

Related issues/PRs

none identified so far

Suggest a fix

It could be as easy as just fixing the respective pom.xml mustache template and remove the duplicated spring-boot-starter-restclient from the test scoped dependencies, as it is compile scope already and does not need to be repeated.

Lingua principale
Java
Stelle
26.8k
Fork
7.7k
Merge medio
1g 15h
PR unite (30g)
158

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenAPITools/openapi-generator

Tutte le issue di OpenAPITools/openapi-generator

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.