This commit is a backport of three PRs #13182 #13183 #13184 Mainly it switched the Gradle to version 7 and applies fixes to make it run.