This also makes the Gradle build work with JDK 17.
The extra JVM args in gradle.properties works around a bug with spotless
and JDK 17: https://github.com/diffplug/spotless/issues/834
PMD.CloseResource was ignored because it's almost always a false
positive, and there are many of them.
The Gradle heap size default is 512M, and that's becoming too small for our builds.
Developers who want to override this without editing the project's build.gradle can
override these settings with gradle.properties in GRADLE_USER_HOME (see
https://docs.gradle.org/current/userguide/build_environment.html for details).