Configure the built-in wrapper task instead of redeclaring it

MSAL

Gradle 4.8 deprecated replacing a built-in task and Gradle 5.0 made it an error, which still fails on Gradle 8.14.4 and 9.8.2: Cannot add task 'wrapper' as a task with that name already exists. This recipe rewrites task wrapper(type: Wrapper) { .. }, tasks.register('wrapper', Wrapper) { .. } and tasks.create('wrapper', Wrapper) { .. } to wrapper { .. }, and the Kotlin forms to tasks.wrapper { .. }. A declaration without configuration is removed. Only the root project has a built-in wrapper task, so declarations in a subproject, which still work, are left alone, as are declarations nested in a block and those with other arguments such as group:. See the Gradle upgrade guide.

org.openrewrite.gradle.migrate.tasks.ReplaceBuiltInWrapperTask
mod run . --recipe=org.openrewrite.gradle.migrate.tasks.ReplaceBuiltInWrapperTask

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