# BOMs broken (java-platforms) for non transitive (e.g. ear deploy) configurations?

**URL:** <https://discuss.gradle.org/t/boms-broken-java-platforms-for-non-transitive-e-g-ear-deploy-configurations/33475>\
**Category:** Help/Discuss\
**Created:** [October 10, 2019, 8:42am UTC](https://discuss.gradle.org/t/boms-broken-java-platforms-for-non-transitive-e-g-ear-deploy-configurations/33475 "2019-10-10T08:42:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![geissld](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/geissld/32/12115_2.png) [@geissld](https://discuss.gradle.org/u/geissld)\
**Post date:** [October 10, 2019, 8:42am UTC](https://discuss.gradle.org/t/boms-broken-java-platforms-for-non-transitive-e-g-ear-deploy-configurations/33475/1 "2019-10-10T08:42:23Z")

</div>

I have a multi project build that depends on artifacts from another multi project build. So I used the `java-platform` plugin on the parent to create a BOM that can be consumed by the modules/subprojects of the 2nd project without messing around with the version numbers.

This works great for the configurations in `java` and `war` projects, but I can not get it to work for `ear` projects. The problem is, that although I add the `platform` dependency to the `deploy` configuration - it does not resolve any versions (die `earlib` `platform` dependency works).

```gradle
plugins {
    id 'ear'
}
dependencies {
    earlib platform(project(':')) // adding bom with version constraints
    deploy platform(project(':')) // adding bom with version constraints

    earlib 'commons-lang:commons-lang' // this works
    deploy 'commons-logging:commons-logging' // this fails with missing version
}

```

I’ve created a reproducer project just in case one wants to try it out:

> **[dgeissl/gradle-showcase-ear-platform](https://github.com/dgeissl/gradle-showcase-ear-platform/tree/master)**
>
> Showing dependency management via BOM in ear projects - dgeissl/gradle-showcase-ear-platform

Update:  
I’ve narrowed the problem down to the `deploy` configuration to be not transitive:

> <https://github.com/gradle/gradle/blob/master/subprojects/ear/src/main/java/org/gradle/plugins/ear/EarPlugin.java#L207-L208>

every other custom configuration that is `transitive=false` does not resolve BOM versions too (I’ll update the referenced reproducer project), but here is the relevant snippet that does the trick:

```gradle
configurations {
    myNonTransitiveConf {
        transitive = false
    }
}
dependencies {
    myNonTransitiveConf platform(':')
    myNonTransitiveConf 'commons-lang:commons-lang'
}

```

Is there any workaround or does this need a gradle core fix?

---

<div class="post-metadata">

**Author:** ![gamerson](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/gamerson/32/1687_2.png) [@gamerson](https://discuss.gradle.org/u/gamerson)\
**Post date:** [December 19, 2019, 12:15am UTC](https://discuss.gradle.org/t/boms-broken-java-platforms-for-non-transitive-e-g-ear-deploy-configurations/33475/2 "2019-12-19T00:15:05Z")

</div>

I too have run into the issue that the gradle BOM `platform()` doesn’t seem to work for configurations that are not transitive. Is this intentional?

---

<div class="post-metadata">

**Author:** ![claudiorossetto](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@claudiorossetto](https://discuss.gradle.org/u/claudiorossetto)\
**Post date:** [August 26, 2021, 9:25am UTC](https://discuss.gradle.org/t/boms-broken-java-platforms-for-non-transitive-e-g-ear-deploy-configurations/33475/3 "2021-08-26T09:25:08Z")

</div>

I’m facing the same issue with gradle 6.8.2.  
Any news on this topic?

---

<div class="post-metadata">

**Author:** ![geissld](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/geissld/32/12115_2.png) [@geissld](https://discuss.gradle.org/u/geissld)\
**Post date:** [August 26, 2021, 9:40am UTC](https://discuss.gradle.org/t/boms-broken-java-platforms-for-non-transitive-e-g-ear-deploy-configurations/33475/4 "2021-08-26T09:40:29Z")

</div>

My Issue has simply been closed [transitive=false configurations do not resolve java-platform versions · Issue #11030 · gradle/gradle · GitHub](https://github.com/gradle/gradle/issues/11030).  
Feel free to open a new one, maybe the tides will change as more users request this bug/feature.

---

<div class="post-metadata">

**Author:** ![claudiorossetto](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@claudiorossetto](https://discuss.gradle.org/u/claudiorossetto)\
**Post date:** [August 26, 2021, 2:24pm UTC](https://discuss.gradle.org/t/boms-broken-java-platforms-for-non-transitive-e-g-ear-deploy-configurations/33475/5 "2021-08-26T14:24:41Z")

</div>

Just opened [#18129](https://github.com/gradle/gradle/issues/18129) as a feature request.
