Versions from the BOM are not being used and I have no idea why

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:'

    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.


  1. 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.
  2. 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.
  3. 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?

In Gradle 5.0, the notation for importing a Maven BOM was made explicit, there is no longer a detection mechanism.
You will need to do:
implementation platform('com.acme:acme-parent:')

The documentation has the details.

However the guide you link to seems to be missing a Gradle 5.0 update. I’ve linked to this post in the issue tracking progress on this topic.

The Maven migration guide has moved to the user manual.

Okay, this explains everything. Although when I changed it to platform, I got some other errors, the errors at least indicate that it’s trying to treat it differently, and gives me a lead for where to look next.