THRIFT-5553: use newer gradle API (#2561)

Prepare for moving to Gradle 7 by removing use of older Gradle directives
(except the use of maven; the transition to maven-publish is not included here)
diff --git a/lib/java/gradle/environment.gradle b/lib/java/gradle/environment.gradle
index 2f49a0d..224f10f 100644
--- a/lib/java/gradle/environment.gradle
+++ b/lib/java/gradle/environment.gradle
@@ -64,14 +64,14 @@
 }
 
 dependencies {
-    compile "org.slf4j:slf4j-api:${slf4jVersion}"
-    compile "org.apache.httpcomponents:httpclient:${httpclientVersion}"
-    compile "org.apache.httpcomponents:httpcore:${httpcoreVersion}"
-    compile "javax.servlet:javax.servlet-api:${servletVersion}"
-    compile "javax.annotation:javax.annotation-api:${javaxAnnotationVersion}"
-    compile "org.apache.commons:commons-lang3:3.12.0"
+    implementation "org.slf4j:slf4j-api:${slf4jVersion}"
+    implementation "org.apache.httpcomponents:httpclient:${httpclientVersion}"
+    implementation "org.apache.httpcomponents:httpcore:${httpcoreVersion}"
+    implementation "javax.servlet:javax.servlet-api:${servletVersion}"
+    implementation "javax.annotation:javax.annotation-api:${javaxAnnotationVersion}"
+    implementation "org.apache.commons:commons-lang3:3.12.0"
 
     testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
-    testCompile "org.mockito:mockito-all:${mockitoVersion}"
-    testRuntime "org.slf4j:slf4j-log4j12:${slf4jVersion}"
+    testImplementation "org.mockito:mockito-all:${mockitoVersion}"
+    testRuntimeOnly "org.slf4j:slf4j-log4j12:${slf4jVersion}"
 }