Use objects.domainObjectContainer(Foo) instead of Project.container(Foo)

MSAL

Project.container(Class) is deprecated in Gradle 9.2 and scheduled for removal in Gradle 10. This recipe replaces it with ObjectFactory.domainObjectContainer(Class), in Groovy and Kotlin scripts and in the Java, Kotlin and Groovy sources of plugins. ObjectFactory decorates the elements and only takes a public constructor, so an element class that worked before fails on it if it is final, with Class Foo is final, or if its constructor is not public, with No constructors of type Foo match parameters. Such a class is left alone, and so is a Kotlin or Java element class not known to be fit, since Kotlin classes are final by default. The overloads that take a factory or a closure are left alone too. See the Gradle upgrade guide for more information.

org.openrewrite.gradle.migrate.model.UseObjectFactoryDomainObjectContainer
mod run . --recipe=org.openrewrite.gradle.migrate.model.UseObjectFactoryDomainObjectContainer

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.