Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ 初心者向け
#25,202 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Karan-Rastogi がすでに取り組んでいます。

2026年10月9日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java, spring-boot
領域
build-system

調査の方向性

重複した依存関係は、spring-boot ライブラリ用に生成される pom.xml サポートテンプレートから来ています。まず Java の spring-boot ジェネレーターのリソースで spring-boot-starter-restclient を検索してください。compile と test の両方のスコープに現れることを確認し、test スコープ側のコピーを削除します。生成された pom.xml でこの依存関係が一度だけ宣言され、生成されたプロジェクトが Maven 3.10 で mvn clean package によりビルドできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Java
スター
26.8k
フォーク
7.7k
平均マージ
1日 15時間
マージ済み PR(30日)
155

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OpenAPITools/openapi-generator のほかの issue

OpenAPITools/openapi-generator の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。