
The use of method references requires the referenced method to be present even if it isn't called. This made it impossible for Gradle to remove the deprecated methods as it would break our plugin. By switching the lambdas, the methods only have to be present when they're called which will only happen with Gradle 8.2 and earlier. Closes gh-41599