title: No matching variant of micronaut-bom was found when my app depends on a lib that depends on a different micronaut version
body: <p>I have a library with this build.gradle file</p>
  <pre><code>plugins {
      id &quot;java-library&quot;
      id &quot;maven&quot;
      id &quot;com.jfrog.artifactory&quot; version &quot;4.9.8&quot;
  }
  ...
  dependencies {
      annotationProcessor platform(&quot;io.micronaut:micronaut-bom:2.0.0&quot;)
      annotationProcessor &quot;io.micronaut:micronaut-inject-java&quot;
      annotationProcessor &quot;io.micronaut:micronaut-validation&quot;
      implementation platform(&quot;io.micronaut:micronaut-bom:2.0.0&quot;)
      implementation &quot;io.micronaut:micronaut-inject&quot;
      implementation &quot;io.micronaut:micronaut-runtime&quot;
      implementation &quot;javax.annotation:javax.annotation-api&quot;
      implementation &quot;io.micronaut.security:micronaut-security&quot;
      runtimeOnly &quot;ch.qos.logback:logback-classic:1.2.3&quot;
  }
  ....
  </code></pre>
  <p>And an app that uses this lib:</p>
  <pre><code>plugins {
      id &quot;net.ltgt.apt-idea&quot; version &quot;0.21&quot;
      id &quot;com.github.johnrengelman.shadow&quot; version &quot;5.0.0&quot;
      id &quot;application&quot;
      id 'com.bmuschko.docker-remote-api' version '6.6.0'
  }
  ....
  dependencies {
      // Micronaut dependencies
      annotationProcessor platform(&quot;io.micronaut:micronaut-bom:${micronautVersion}&quot;)
      annotationProcessor &quot;io.micronaut:micronaut-inject-java&quot;
      annotationProcessor &quot;io.micronaut:micronaut-validation&quot;
      annotationProcessor &quot;io.micronaut.data:micronaut-data-processor&quot;
      implementation platform(&quot;io.micronaut:micronaut-bom:${micronautVersion}&quot;)
  implementation(&quot;com.acme:my-library:0.0.1-SNAPSHOT&quot;)
      ...
  }
  ....
  </code></pre>
  <p>When the micronaut version differs between app and lib (even when only by a patch version), I get this message when I try to build:</p>
  <pre><code>Could not determine the dependencies of task ':implementation:shadowJar'.
  &gt; Could not resolve all dependencies for configuration ':implementation:runtimeClasspath'.
     &gt; Could not resolve io.micronaut:micronaut-bom:2.0.0.
       Required by:
           project :implementation &gt; com.acme:my-library:0.0.1-SNAPSHOT
        &gt; No matching variant of io.micronaut:micronaut-bom:2.0.2 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally but:
            - Variant 'apiElements' capability io.micronaut:micronaut-bom:2.0.2:
                - Incompatible because this component declares an API of a platform and the consumer needed a runtime of a library
                - Other compatible attributes:
                    - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                    - Doesn't say anything about its target Java version (required compatibility with Java 11)
                    - Doesn't say anything about its elements (required them packaged as a jar)
            - Variant 'enforcedApiElements' capability io.micronaut:micronaut-bom-derived-enforced-platform:2.0.2:
                - Incompatible because this component declares an API of an enforced platform and the consumer needed a runtime of a library
                - Other compatible attributes:
                    - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                    - Doesn't say anything about its target Java version (required compatibility with Java 11)
                    - Doesn't say anything about its elements (required them packaged as a jar)
            - Variant 'enforcedRuntimeElements' capability io.micronaut:micronaut-bom-derived-enforced-platform:2.0.2 declares a runtime of a component:
                - Incompatible because this component declares an enforced platform and the consumer needed a library
                - Other compatible attributes:
                    - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                    - Doesn't say anything about its target Java version (required compatibility with Java 11)
                    - Doesn't say anything about its elements (required them packaged as a jar)
            - Variant 'runtimeElements' capability io.micronaut:micronaut-bom:2.0.2 declares a runtime of a component:
                - Incompatible because this component declares a platform and the consumer needed a library
                - Other compatible attributes:
                    - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                    - Doesn't say anything about its target Java version (required compatibility with Java 11)
                    - Doesn't say anything about its elements (required them packaged as a jar)
  </code></pre>
  <p>I might be doing something wrong, because Gradle should handle version conflicts. What am I missing?</p>