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).
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:
Update:
I’ve narrowed the problem down to the deploy
configuration to be not transitive:
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:
configurations {
myNonTransitiveConf {
transitive = false
}
}
dependencies {
myNonTransitiveConf platform(':')
myNonTransitiveConf 'commons-lang:commons-lang'
}
Is there any workaround or does this need a gradle core fix?