Groovy 4 changed the coordinates of its artifacts, specifically including groovy-bom, from g:org.codehaus.groovy to g:org.apache.groovy. The Spring Boot BOM, however, pulls in a transitive dependencyManagement on the pre-4 coordinate. This means that any project trying to use Groovy 4 with groovy.version will fail to build because the Spring Boot BOM can't resolve the (legitimately nonexistent) org.codehaus.groovy:groovy-bom:4.0.1.
Since there's no way to exclude dependencyManagement, would it be feasible to remove this inline in Boot 2.7 and have consumers specify in their own POM which they want?
Comment From: wilkinsona
would it be feasible to remove this inline in Boot 2.7 and have consumers specify in their own POM which they want?
No, I don't think so as that would inconvenience anyone wanting to use groovy.version to select a different version of Groovy 3.0.x. Supporting Groovy 4.0 is a fairly major change as it will also affect things like spring-boot-starter-groovy-templates which pulls in org.codehaus.groovy:groovy-templates.
I've opened https://github.com/spring-projects/spring-boot/issues/30279 so that we can look at upgrading to Groovy 4.0 in Spring Boot 3. In the meantime, if you want to use Groovy 4.0, I'd try importing its bom at its new coordinates in your application's pom rather than overriding groovy.version. Before doing so, please note that using Groovy 4 is completely untested and, as such, isn't something that we'd recommend or support at this time.