THRIFT-5584: use gradle toolchain to specify Java 11 with --release 8 (#2606)
* use gradle toolchain to specify Java 11 with --release 8
* use newer syntax
* fix spotless apply
* remove legacy apply and bump version of spot bugs
* migrate pmd to new plugin syntax
diff --git a/lib/java/build.gradle b/lib/java/build.gradle
index 8206411..c8fc27c 100644
--- a/lib/java/build.gradle
+++ b/lib/java/build.gradle
@@ -39,6 +39,7 @@
id 'java-library'
id 'maven-publish'
id 'signing'
+ id 'pmd'
id 'com.github.johnrengelman.shadow' version '6.1.0'
id "com.github.spotbugs" version "4.7.1"
id "com.diffplug.spotless" version "6.5.2"