Skip to content

Manage non-Spring (Swagger) dependencies in a separate bom #1280

Closed
@MitchelLabonte

Description

@MitchelLabonte

Is your feature request related to a problem? Please describe.
I have a project with the spring-cloud-starter-parent parent. This manages Spring Cloud and Spring Boot dependencies.
I use SpringDoc, and some modules have dependencies on Swagger modules only. To have SpringDoc manage the Swagger versions, I import the springdoc-openapi dependencies like this in dependencyManagement:

<dependency>
    <groupId>org.springdoc</groupId>
    <artifactId>springdoc-openapi</artifactId>
    <version>${springdoc.version}</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

Unfortunately, this doesn't only manage springdoc and Swagger dependencies, but also overrides Spring Boot's dependency management (since springdoc-openapi has spring-boot-starter-parent as a parent.

Right now, my workaround is to hardcode the version of spring-boot-dependencies in dependencyManagement.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-dependencies</artifactId>
    <version>2.4.10</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

Describe the solution you'd like
A potential solution could be to create a separate springdoc-openapi-dependencies which I could import using the same version as other springdoc modules:

<dependency>
    <groupId>org.springdoc</groupId>
    <artifactId>springdoc-openapi-dependencies</artifactId>
    <version>${springdoc.version}</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

This module could solely manage the external dependencies not managed by Spring Boot (e.g. Swagger).

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions