Using springdoc-openapi as BOM uses Gradle project verson rather than BOM version
See original GitHub issueDescribe the bug
I don’t see it in the project documentation, but from springdoc/springdoc-openapi#1099 & springdoc/springdoc-openapi#1256, it looks like springdoc-openapi is designed to be used as a BOM, enforcing the dependency versions in the project to match the version of the BOM.
When I use this project as a BOM with Gradle using the Spring dependency management plugin, it uses the version of my Gradle project as the SpringDoc versions, rather than the version of the BOM. For instance, if I have my Gradle project at version 0.0.1, use org.springdoc:springdoc-openapi:1.6.1 as a BOM, and import org.springdoc:springdoc-openapi-ui, the version of springdoc-openapi-ui will be 0.0.1, not 1.6.1.
To Reproduce
build.gradle
plugins {
id 'org.springframework.boot' version '2.6.1'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1'
sourceCompatibility = '11'
repositories {
mavenCentral()
}
dependencyManagement {
imports {
mavenBom 'org.springdoc:springdoc-openapi:1.6.1'
mavenBom 'org.springframework.boot:spring-boot-dependencies:2.6.1'
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springdoc:springdoc-openapi-ui'
}
Execute
$ gradle compileJava
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.springdoc:springdoc-openapi-ui:0.0.1.
Required by:
project :
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
1 actionable task: 1 executed
Expected behavior
The expected behavior is that the version used for the springdoc-openapi BOM be used for the org.springdoc dependencies.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)

Top Related StackOverflow Question
@mjustin,
I have enhanced the BOM support so that we get rid of the
bomPropertyline for next releases. You can already validate it using the latest SNAPSHOT.I can confirm that the updated BOM works as desired in my Gradle project where I found this issue. Thanks for the quick fix!