Fix jdk10 support in travis (#4653)

For jdk10: disable errorprone and fix javadoc warnings
diff --git a/build.gradle b/build.gradle
index 5a01e6e..46b8c2c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -26,7 +26,9 @@
     apply plugin: "com.google.osdetector"
     // The plugin only has an effect if a signature is specified
     apply plugin: "ru.vyarus.animalsniffer"
-    if (!rootProject.hasProperty('errorProne') || rootProject.errorProne.toBoolean()) {
+    // jdk10 not supported by errorprone: https://github.com/google/error-prone/issues/860
+    if (!JavaVersion.current().isJava10Compatible() &&
+        rootProject.properties.get('errorProne', true)) {
         apply plugin: "net.ltgt.errorprone"
         apply plugin: "net.ltgt.apt"
 
@@ -281,6 +283,15 @@
         }
     }
 
+    // For jdk10 we must explicitly choose between html4 and html5, otherwise we get a warning
+    if (JavaVersion.current().isJava10Compatible()) {
+        allprojects {
+            tasks.withType(Javadoc) {
+                options.addBooleanOption('html4', true)
+            }
+        }
+    }
+
     checkstyle {
         configFile = file("$rootDir/buildscripts/checkstyle.xml")
         toolVersion = "6.17"