Coming from older versions of gradle, before buildlogic and version catalogs, which I’m trying to migrate to these now.
In my module’s build.gradle I used to have something along the lines of:
configurations.all {
...
exclude group: 'org.apache.openejb', module: 'javaee-api'
...
}
dependencies {
...
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
...
}
...
In the effort to use build conventions, build.gradle changed:
configurations.all
section was moved to buildSrc/src/main/groovy/buildlogic.xxx-conventions.gradle
:
configurations.all {
...
exclude group: 'org.apache.openejb', module: 'javaee-api'
...
}
And then the build.gradle
changed to:
plugins {
id 'buildlogic.xxx-conventions'
...
}
dependencies {
...
implementation libs.spring.boot.starter.data.jpa
...
}
Everything seems works fine, except the buildlogic version ends up with more dependencies, which tells me the move of the exclusions don’t work as expected.
The documentation talks about individual exclusions, but this is done one by one, wheras configurations.all
is a kind of global exclusion.
How do I define these exclusions with buildconventions?