kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From granthe...@apache.org
Subject [kudu] 03/03: [Java] Upgrade dependencies
Date Thu, 28 Mar 2019 22:00:06 GMT
This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 2389f192725cf5cbd4d73a97ec20e02d66259e4b
Author: Grant Henke <granthenke@apache.org>
AuthorDate: Wed Mar 27 09:46:51 2019 -0500

    [Java] Upgrade dependencies
    
    Upgrades the Java dependencies and Gradle versions.
    
    Some rework of the Error Prone plugin configuration
    was needed to get on a current version.
    
    Gradle now includes a license in the wrapper script
    so the custom license injection was removed.
    I also removed it from the properties file, since it’s
    configuration data rather than code and simple enough
    that it would count as a non-copyrightable statement of facts.
    
    Major version upgrades:
    - hamcrest 1.3 -> 2.1
    
    Minor version upgrades:
    - guava 27.0.1-jre -> 27.1-jre
    - mockito 2.23.4 -> 2.25.1
    - protobuf 3.6.1 -> 3.7.0
    
    Maintenance version upgrades:
    - osdetector 1.6.1 -> 1.6.2
    - scalatest 3.0.5 -> 3.0.7
    - slf4j 1.7.25 -> 1.7.26
    
    Gradle upgrades:
    - gradle 5.1.1 -> 5.3.1
    - gradle-versions-plugin 0.20.0 -> 0.21.0
    - shadow 4.0.4 -> 5.0.0
    - nebula-clojure-plugin 8.0.0 -> 8.1.1
    - spotbugs-gradle-plugin 1.6.9 -> 1.7.0
    - gradle-errorprone-plugin 0.0.16 -> 0.7.1
    
    Change-Id: I25d73cfa715c7a5ed1d572b3d3a8f63607f0fed2
    Reviewed-on: http://gerrit.cloudera.org:8080/12869
    Reviewed-by: Adar Dembo <adar@cloudera.com>
    Tested-by: Kudu Jenkins
---
 build-support/release/rat_exclude_files.txt   |  1 +
 java/buildSrc/build.gradle                    | 10 +++----
 java/gradle/dependencies.gradle               | 25 ++++++++--------
 java/gradle/quality.gradle                    | 38 ++++++++++++------------
 java/gradle/wrapper.gradle                    | 42 +--------------------------
 java/gradle/wrapper/gradle-wrapper.properties | 16 +---------
 java/gradlew                                  |  8 +++--
 java/kudu-client/build.gradle                 |  1 +
 8 files changed, 47 insertions(+), 94 deletions(-)

diff --git a/build-support/release/rat_exclude_files.txt b/build-support/release/rat_exclude_files.txt
index 5c5a47b..786ea58 100644
--- a/build-support/release/rat_exclude_files.txt
+++ b/build-support/release/rat_exclude_files.txt
@@ -23,6 +23,7 @@ docs/support/doxygen/client_api.footer.in
 examples/README.md
 examples/python/graphite-kudu/setup.cfg
 java/.scalafmt.conf
+java/gradle/gradle-wrapper.properties
 java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
 java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduScanner.java
 java/kudu-client/src/main/java/org/apache/kudu/client/Bytes.java
diff --git a/java/buildSrc/build.gradle b/java/buildSrc/build.gradle
index f9a6807..9229556 100644
--- a/java/buildSrc/build.gradle
+++ b/java/buildSrc/build.gradle
@@ -29,13 +29,13 @@ repositories {
 // For more details see: https://docs.gradle.org/current/userguide/plugins.html#plugins_dsl_limitations
 dependencies {
   compile "com.commercehub.gradle.plugin:gradle-avro-plugin:0.16.0"
-  compile "com.github.ben-manes:gradle-versions-plugin:0.20.0"
-  compile "com.github.jengelman.gradle.plugins:shadow:4.0.4"
+  compile "com.github.ben-manes:gradle-versions-plugin:0.21.0"
+  compile "com.github.jengelman.gradle.plugins:shadow:5.0.0"
   compile "com.google.protobuf:protobuf-gradle-plugin:0.8.8"
-  compile "com.netflix.nebula:nebula-clojure-plugin:8.0.0"
-  compile "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.9"
+  compile "com.netflix.nebula:nebula-clojure-plugin:8.1.1"
+  compile "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.7.0"
   compile "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE"
-  compile "net.ltgt.gradle:gradle-errorprone-plugin:0.0.16"
+  compile "net.ltgt.gradle:gradle-errorprone-plugin:0.7.1"
   compile "ru.vyarus:gradle-animalsniffer-plugin:1.5.0"
   compile 'com.google.code.gson:gson:2.8.5'
   compile "cz.alenkacz:gradle-scalafmt:1.7.2"
diff --git a/java/gradle/dependencies.gradle b/java/gradle/dependencies.gradle
index d8114f0..433e010 100755
--- a/java/gradle/dependencies.gradle
+++ b/java/gradle/dependencies.gradle
@@ -30,31 +30,30 @@ versions += [
     clojure        : "1.9.0",
     clojureToolsCli: "0.4.1",
     commonsIo      : "2.6",
-    // errorprone 2.3.2+ has an issue on older JDKs see
-    // https://github.com/google/error-prone/issues/1140
-    errorprone     : "2.3.1",
+    errorProne     : "2.3.3",
+    errorProneJavac: "9+181-r4173-1",
     flume          : "1.9.0",
-    gradle         : "5.1.1",
-    guava          : "27.0.1-jre",
+    gradle         : "5.3.1",
+    guava          : "27.1-jre",
     hadoop         : "3.2.0",
-    hamcrest       : "1.3",
+    hamcrest       : "2.1",
     hdrhistogram   : "2.1.11",
     hive           : "2.3.4",
     jepsen         : "0.1.5",
     jsr305         : "3.0.2",
     junit          : "4.12",
     log4j          : "1.2.17",
-    mockito        : "2.23.4",
+    mockito        : "2.25.1",
     murmur         : "1.0.0",
     netty          : "3.10.6.Final",
-    osdetector     : "1.6.1",
+    osdetector     : "1.6.2",
     parquet        : "1.10.1",
     pmd            : "5.8.1",
-    protobuf       : "3.6.1",
+    protobuf       : "3.7.0",
     scala          : "2.11.12",
-    scalatest      : "3.0.5",
+    scalatest      : "3.0.7",
     scopt          : "3.7.1",
-    slf4j          : "1.7.25",
+    slf4j          : "1.7.26",
     spark          : "2.4.0",
     spotBugs       : "3.1.6",
     yetus          : "0.9.0"
@@ -77,7 +76,8 @@ libs += [
     clojure              : "org.clojure:clojure:$versions.clojure",
     clojureToolsCli      : "org.clojure:tools.cli:$versions.clojureToolsCli",
     commonsIo            : "commons-io:commons-io:$versions.commonsIo",
-    errorProne           : "com.google.errorprone:error_prone_core:$versions.errorprone",
+    errorProne           : "com.google.errorprone:error_prone_core:$versions.errorProne",
+    errorProneJavac      : "com.google.errorprone:javac:$versions.errorProneJavac",
     flumeConfiguration   : "org.apache.flume:flume-ng-configuration:$versions.flume",
     flumeCore            : "org.apache.flume:flume-ng-core:$versions.flume",
     guava                : "com.google.guava:guava:$versions.guava",
@@ -86,6 +86,7 @@ libs += [
     hadoopMRClientCommon : "org.apache.hadoop:hadoop-mapreduce-client-common:$versions.hadoop",
     hadoopMRClientCore   : "org.apache.hadoop:hadoop-mapreduce-client-core:$versions.hadoop",
     hamcrestCore         : "org.hamcrest:hamcrest-core:$versions.hamcrest",
+    hamcrestLib          : "org.hamcrest:hamcrest-library:$versions.hamcrest",
     hdrhistogram         : "org.hdrhistogram:HdrHistogram:$versions.hdrhistogram",
     hiveMetastore        : "org.apache.hive:hive-metastore:$versions.hive",
     hiveMetastoreTest    : "org.apache.hive:hive-metastore:$versions.hive:tests",
diff --git a/java/gradle/quality.gradle b/java/gradle/quality.gradle
index c3d14cf..c92d0b2 100644
--- a/java/gradle/quality.gradle
+++ b/java/gradle/quality.gradle
@@ -22,7 +22,9 @@ apply plugin: "com.github.spotbugs"   // Performs static code analysis to
look f
 apply plugin: "pmd"        // Performs static code analysis to look for common code smells
in Java code.
 apply plugin: "com.github.ben-manes.versions" // Provides a task to determine which dependencies
have updates.
 apply plugin: "ru.vyarus.animalsniffer" // Ensures Java code uses APIs from a particular
version of Java.
-apply plugin: "scalafmt"
+apply plugin: "scalafmt" // Automatically formats Scala code on each build.
+apply plugin: "net.ltgt.errorprone" // Performs static code analysis to look for bugs in
Java code.
+
 
 checkstyle {
   configFile = file("$rootDir/kudu_style.xml")
@@ -67,7 +69,7 @@ scalafmt {
   configFilePath = "$rootDir/.scalafmt.conf"
 }
 
-// Run scalafmt on compile
+// Run scalafmt on compile.
 tasks.withType(ScalaCompile) {
   if (!propertyExists("skipFormat")) {
      dependsOn("scalafmtAll")
@@ -80,26 +82,25 @@ task pmd(dependsOn: [pmdMain, pmdTest], group: "Verification") {
   description = "Run PMD analysis."
 }
 
-
-// Disable error-prone if we are compiling with Java 10+ util support is added.
-// See https://github.com/google/error-prone/issues/860
-if (!JavaVersion.current().isJava10Compatible()) {
-  // Enable error-prone.
-  // Running with '-Derrorprone-fix=...' can instruct error-prone to automatically fix issues.
-  apply plugin: "net.ltgt.errorprone"
-  // Performs static code analysis to look for bugs in Java code.
-  tasks.withType(JavaCompile) {
-    options.compilerArgs += ['-XepExcludedPaths:.*/build/generated.*/.*',
-                             '-XepAllErrorsAsWarnings']
+// Configure error-prone.
+// Running with '-Derrorprone-fix=...' can instruct error-prone to automatically fix issues.
+tasks.withType(JavaCompile) {
+  options.errorprone {
+    disableWarningsInGeneratedCode = true
+    excludedPaths = '.*/build/generated.*/.*'
+    allErrorsAsWarnings = true
     def fix = propertyWithDefault("errorprone-fix", "")
     if (!fix.isEmpty()) {
-      options.compilerArgs += ['-XepPatchChecks:' + fix, '-XepPatchLocation:IN_PLACE']
+      errorproneArgs += ['-XepPatchChecks:' + fix, '-XepPatchLocation:IN_PLACE']
     }
   }
-// Set a specific version of Error Prone
-  dependencies {
-    errorprone libs.errorProne
-  }
+}
+dependencies {
+  // Set a specific version of Error Prone
+  errorprone libs.errorProne
+  // Configure Error Prone to use it's own static javac as described here:
+  // https://github.com/tbroyer/gradle-errorprone-plugin#jdk-8-support
+  errorproneJavac libs.errorProneJavac
 }
 
 // Define a Java API signature for use by animal-sniffer. It'll enforce that all
@@ -116,6 +117,7 @@ task animalsniffer(dependsOn: [animalsnifferMain, animalsnifferTest],
group: "Ve
 
 // Configure the versions plugin to only show dependency updates for released versions.
 dependencyUpdates {
+  gradleReleaseChannel = "current"
   revision = "release"
   resolutionStrategy = {
     componentSelection { rules ->
diff --git a/java/gradle/wrapper.gradle b/java/gradle/wrapper.gradle
index 708c8be..fe268b7 100644
--- a/java/gradle/wrapper.gradle
+++ b/java/gradle/wrapper.gradle
@@ -26,21 +26,6 @@ wrapper {
   distributionUrl = "${gradleDistUrlBase}/gradle-${versions.gradle}-all.zip"
 }
 
-def licenseString = """#
-# Copyright 2017 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License."""
-
 // Custom task to inject support for downloading the gradle wrapper jar if it doesn't exist.
 // This allows us to avoid checking in the jar to our repository.
 // Additionally adds a license header to the wrapper while editing the file contents.
@@ -71,7 +56,6 @@ task bootstrapWrapper() {
     def wrapperScript = wrapper.scriptFile
     def wrapperLines = wrapperScript.readLines()
     wrapperScript.withPrintWriter { out ->
-      def licenseWritten = false
       def bootstrapWritten = false
       wrapperLines.each { line ->
         // Print the wrapper bootstrap before the first usage of the wrapper jar.
@@ -79,36 +63,12 @@ task bootstrapWrapper() {
           out.println(bootstrapString)
           bootstrapWritten = true
         }
-        out.print(line)
-        // Print the licence after the shebang.
-        if(!licenseWritten && line.contains("#!/usr/bin/env sh")) {
-          out.println()
-          out.print(licenseString)
-          licenseWritten = true
-        }
-        out.println() // New Line
-      }
-    }
-  }
-}
-wrapper.finalizedBy bootstrapWrapper
-
-// Custom task to add a license header to the gradle-wrapper.properties file.
-task bootstrapWrapperProperties() {
-  // In the doLast block so this runs when the task is called and not during project configuration.
-  doLast {
-    def wrapperProperties = wrapper.propertiesFile
-    def wrapperLines = wrapperProperties.readLines()
-    wrapperProperties.withPrintWriter { out ->
-      // Print the license
-      out.println(licenseString)
-      wrapperLines.each { line ->
         out.println(line)
       }
     }
   }
 }
-wrapper.finalizedBy bootstrapWrapperProperties
+wrapper.finalizedBy bootstrapWrapper
 
 // Remove the generated batch file since we don't test building in the Windows environment.
 task removeWindowScript(type: Delete) {
diff --git a/java/gradle/wrapper/gradle-wrapper.properties b/java/gradle/wrapper/gradle-wrapper.properties
index 19af522..51fb1c4 100644
--- a/java/gradle/wrapper/gradle-wrapper.properties
+++ b/java/gradle/wrapper/gradle-wrapper.properties
@@ -1,19 +1,5 @@
-#
-# Copyright 2017 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git a/java/gradlew b/java/gradlew
index ed25bfa..c40d514 100755
--- a/java/gradlew
+++ b/java/gradlew
@@ -1,18 +1,20 @@
 #!/usr/bin/env sh
+
 #
-# Copyright 2017 the original author or authors.
+# Copyright 2015 the original author or authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
 #
-#    http://www.apache.org/licenses/LICENSE-2.0
+#      http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+#
 
 ##############################################################################
 ##
@@ -42,7 +44,7 @@ APP_NAME="Gradle"
 APP_BASE_NAME=`basename "$0"`
 
 # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options
to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m"'
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
 
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 MAX_FD="maximum"
diff --git a/java/kudu-client/build.gradle b/java/kudu-client/build.gradle
index 2b99355..ef20ddc 100644
--- a/java/kudu-client/build.gradle
+++ b/java/kudu-client/build.gradle
@@ -37,6 +37,7 @@ dependencies {
 
   testCompile project(":kudu-test-utils")
   testCompile libs.hamcrestCore
+  testCompile libs.hamcrestLib
   testCompile libs.hiveMetastore
   // The HMS client relies on the MR client-core artifact for JobConf, but only
   // specifies it as an optional dependency. Gradle doesn't pull in optional


Mime
View raw message