gradle-consistent-versions
gradle-consistent-versions copied to clipboard
FR: Ban platform() dependencies if java-base was not applied
What happened?
People regularly import boms into all projects like so:
allprojects {
dependencies {
rootConfiguration platform('org:my-bom')
}
}
But this doesn't actually behave as expected unless each project has java-base applied.
This is because java-base adds some magic that handles these platform() dependencies in a special way.
This then has the side effect that certain configurations that expect exactly oen artifact (e.g. gradle-conjure's tool configurations - conjureJava etc) end up broken, if the BOM in question also has a non-empty <dependencies> block, because the dependency ends up interpreted as a plain library dependency.
What did you want to happen?
Either
- users should get an error if they add
platform()dependencies to projects that do not applyjava-base, or - GCV should instrument all repos to handle
platform()dependencies in some way that makes sense for non-java repos, e.g. by ignoring them