I heard Gradle 5.0+ can use BOMs to apply versions of required dependencies, so I thought I’d try using it.
My build script has this:
dependencies {
// Supposedly this is how you import a BOM even though it looks exactly like a normal dependency.
implementation 'com.acme:acme-parent:7.8.0.9'
implementation 'com.acme:acme-api'
runtimeOnly 'com.acme:acme-impl'
}
When I try to build, I get this:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find com.acme:acme-api:.
Required by:
project :
The way it has put a .
in for the version makes it seem like the BOM versions are not being used.
Questions:
- Is there a problem with how I’ve added the dependency? It’s a bit confusing, because it looks like any other dependency to me. But indeed, Gradle’s own documentation has the same syntax in its example.
- If the syntax really is exactly the same, how does Gradle distinguish a dependency which is supposed to be a BOM from any other dependency? All POMs look the same to me.
- If somehow a dependency which is supposed to be a BOM was imported not as a BOM but as a normal dependency, how would I figure that out using the available commands in Gradle?