diff --git a/build.gradle b/build.gradle index fbce6c40a..7a6d101eb 100755 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ buildscript { repositories { mavenCentral() maven { - url "http://repo.spring.io/milestone" + url "https://repo.spring.io/milestone/" } maven { url 'https://jitpack.io' } gradlePluginPortal() @@ -35,12 +35,12 @@ buildscript { plugins { id 'com.github.kt3k.coveralls' version '2.10.1' - id 'nebula.netflixoss' version '9.4.1' + id 'nebula.netflixoss' version '10.6.0' id 'org.springframework.boot' version "${spring_boot_version}" apply false - id 'com.gorylenko.gradle-git-properties' version '2.2.2' apply false - id 'io.franzbecker.gradle-lombok' version '4.0.0' apply false + id 'com.gorylenko.gradle-git-properties' version '2.3.2' apply false + id 'io.franzbecker.gradle-lombok' version '5.0.0' id 'nebula.node' version '1.3.1' apply false - id 'com.github.spotbugs' version '4.4.1' apply false + id 'com.github.spotbugs' version '5.2.5' apply false } apply plugin: "nebula-aggregate-javadocs" @@ -58,15 +58,20 @@ allprojects { apply plugin: "idea" apply plugin: "eclipse" apply plugin: "nebula.netflixoss" + apply plugin: 'java-library' apply plugin: "io.franzbecker.gradle-lombok" + lombok { + version = '1.18.30' + } + repositories { mavenCentral() maven { - url "http://repo.spring.io/milestone" + url "https://repo.spring.io/milestone" } maven { - url "http://redshift-maven-repository.s3-website-us-east-1.amazonaws.com/release" + url "https://redshift-maven-repository.s3-website-us-east-1.amazonaws.com/release" } maven { url 'https://jitpack.io' @@ -76,8 +81,8 @@ allprojects { idea { project { - jdkName = "1.8" - languageLevel = "1.8" + jdkName = "8" + languageLevel = "8" vcs = "Git" } } @@ -93,8 +98,8 @@ configure(javaProjects) { group = "com.netflix.${githubProjectName}" - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 dependencyManagement { imports { @@ -104,9 +109,9 @@ configure(javaProjects) { mavenBom "com.google.inject:guice-bom:${google_guice_version}" } dependencies { - dependency("com.github.spotbugs:spotbugs-annotations:4.0.6") + dependency("com.github.spotbugs:spotbugs-annotations:4.8.2") dependency("org.codehaus.groovy:groovy-all:2.5.9") - dependencySet(group: "org.ow2.asm", version: "8.0.1") { + dependencySet(group: "org.ow2.asm", version: "9.2") { entry "asm" entry "asm-analysis" entry "asm-commons" @@ -114,7 +119,7 @@ configure(javaProjects) { entry "asm-util" } dependency("cglib:cglib-nodep:3.2.4") - dependency("com.amazon.redshift:redshift-jdbc42:1.2.1.1001") + dependency("com.amazon.redshift:redshift-jdbc42:2.1.0.21") dependency("com.github.fge:json-patch:1.9") dependency("com.github.rholder:guava-retrying:2.0.0") dependency("commons-dbutils:commons-dbutils:1.6") @@ -159,7 +164,6 @@ configure(javaProjects) { } dependencies { - /******************************* * Compile Dependencies *******************************/ @@ -168,6 +172,7 @@ configure(javaProjects) { * Provided Dependencies *******************************/ compileOnly("com.github.spotbugs:spotbugs-annotations") + /******************************* * Runtime Dependencies *******************************/ @@ -177,20 +182,20 @@ configure(javaProjects) { /******************************* * Test Dependencies *******************************/ - testCompile("log4j:log4j") - testCompile("cglib:cglib-nodep") - testCompile("org.codehaus.groovy:groovy-all") - testCompile("org.codehaus.gpars:gpars") - testCompile("org.objenesis:objenesis") - testCompile("org.spockframework:spock-core") - testCompile("org.spockframework:spock-guice") - testCompile("org.spockframework:spock-spring") - testCompile("org.springframework.boot:spring-boot-starter-test") { + testImplementation("log4j:log4j") + testImplementation("cglib:cglib-nodep") + testImplementation("org.codehaus.groovy:groovy-all") + testImplementation("org.codehaus.gpars:gpars") + testImplementation("org.objenesis:objenesis:3.2") + testImplementation("org.spockframework:spock-core") + testImplementation("org.spockframework:spock-guice") + testImplementation("org.spockframework:spock-spring") + testImplementation("org.springframework.boot:spring-boot-starter-test") { exclude group: 'com.vaadin.external.google', module: 'android-json' } - testRuntime("org.hsqldb:hsqldb") + testRuntimeOnly("org.hsqldb:hsqldb") testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1' - testCompile("org.junit.jupiter:junit-jupiter-api:5.4.2") + testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.2") testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.2") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.4.2") testRuntimeOnly "org.junit.platform:junit-platform-commons:1.7.0" @@ -217,7 +222,7 @@ configure(javaProjects) { } spotbugs { - toolVersion = '4.0.6' + toolVersion = '4.8.2' jvmArgs = ['-Xmx4g', '-XX:+HeapDumpOnOutOfMemoryError'] excludeFilter = new File(project.parent.projectDir, "codequality/findbugs/excludeFilter.xml") } @@ -232,9 +237,9 @@ configure(javaProjects) { jacocoTestReport { reports { - html.enabled = true - xml.enabled = true - csv.enabled = false + html.required = true + xml.required = true + csv.required = false } } diff --git a/codequality/findbugs/excludeFilter.xml b/codequality/findbugs/excludeFilter.xml index 56b57b6f0..a03ecb2ea 100644 --- a/codequality/findbugs/excludeFilter.xml +++ b/codequality/findbugs/excludeFilter.xml @@ -25,4 +25,8 @@ + + + + diff --git a/gradle.properties b/gradle.properties index a4376f118..75fe3dfd0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ spring_boot_version=2.7.11 spring_cloud_version=Hoxton.SR8 google_guice_version=4.1.0 -spock_version=2.0-groovy-3.0 +spock_version=2.1-groovy-3.0 ## Override Spring Boot versions diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 62d4c0535..7454180f2 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 442d9132e..e750102e0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index fbd7c5158..1b6c78733 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${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" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,95 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index a9f778a7a..ac1b06f93 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/metacat-app/build.gradle b/metacat-app/build.gradle index bab102f6a..c0663675e 100644 --- a/metacat-app/build.gradle +++ b/metacat-app/build.gradle @@ -14,7 +14,7 @@ dependencies { * Compile Dependencies *******************************/ - compile(project(":metacat-main")) + implementation(project(":metacat-main")) /******************************* * Provided Dependencies diff --git a/metacat-client/build.gradle b/metacat-client/build.gradle index 637e42655..b891a4af1 100644 --- a/metacat-client/build.gradle +++ b/metacat-client/build.gradle @@ -20,21 +20,21 @@ dependencies { * API Dependencies *******************************/ - compile(project(":metacat-common")) + api(project(":metacat-common")) - compile("io.github.openfeign:feign-core") + api("io.github.openfeign:feign-core") /******************************* * Implementation Dependencies *******************************/ - compile("com.fasterxml.jackson.core:jackson-databind") - compile("com.fasterxml.jackson.datatype:jackson-datatype-guava") - compile("com.fasterxml.jackson.module:jackson-module-jaxb-annotations") - compile("com.google.guava:guava") - compile("io.github.openfeign:feign-jaxrs") - compile("io.github.openfeign:feign-slf4j") - compile("org.slf4j:slf4j-api") + implementation("com.fasterxml.jackson.core:jackson-databind") + implementation("com.fasterxml.jackson.datatype:jackson-datatype-guava") + implementation("com.fasterxml.jackson.module:jackson-module-jaxb-annotations") + implementation("com.google.guava:guava") + implementation("io.github.openfeign:feign-jaxrs") + implementation("io.github.openfeign:feign-slf4j") + implementation("org.slf4j:slf4j-api") /******************************* * Provided Dependencies @@ -48,5 +48,5 @@ dependencies { * Test Dependencies *******************************/ - testCompile(project(":metacat-common").sourceSets.test.output) + testImplementation(project(":metacat-common").sourceSets.test.output) } diff --git a/metacat-common-server/build.gradle b/metacat-common-server/build.gradle index 6c68d1a4c..f4ef1e6a7 100644 --- a/metacat-common-server/build.gradle +++ b/metacat-common-server/build.gradle @@ -25,27 +25,27 @@ dependencies { * API Dependencies *******************************/ - compile(project(":metacat-common")) - compile("com.google.inject:guice") - compile("net.sf.dozer:dozer") - compile("org.apache.tomcat:tomcat-jdbc") + api(project(":metacat-common")) + api("com.google.inject:guice") + api("net.sf.dozer:dozer") + api("org.apache.tomcat:tomcat-jdbc") + api("org.springframework.boot:spring-boot-starter") + api("org.springframework:spring-jdbc") + api("com.netflix.spectator:spectator-api") /******************************* * Implementation Dependencies *******************************/ - compile("com.netflix.spectator:spectator-api") - compile("com.google.guava:guava") - compile("org.slf4j:slf4j-api") - compile("org.springframework.boot:spring-boot-starter") - compile("org.springframework.boot:spring-boot-starter-logging") - compile("org.springframework:spring-jdbc") + implementation("com.google.guava:guava") + implementation("org.slf4j:slf4j-api") + implementation("org.springframework.boot:spring-boot-starter-logging") /******************************* * Provided Dependencies *******************************/ - compileOnly("org.springframework.boot:spring-boot-configuration-processor") + implementation("org.springframework.boot:spring-boot-configuration-processor") /******************************* * Runtime Dependencies @@ -55,8 +55,8 @@ dependencies { * Test Dependencies *******************************/ - testCompile(project(":metacat-common").sourceSets.test.output) - testCompile("commons-logging:commons-logging") + testImplementation(project(":metacat-common").sourceSets.test.output) + testImplementation("commons-logging:commons-logging") } tasks.withType(Checkstyle) { diff --git a/metacat-common-server/src/main/java/com/netflix/metacat/common/server/partition/util/FilterPartition.java b/metacat-common-server/src/main/java/com/netflix/metacat/common/server/partition/util/FilterPartition.java index 7f0abd940..16d0449f8 100644 --- a/metacat-common-server/src/main/java/com/netflix/metacat/common/server/partition/util/FilterPartition.java +++ b/metacat-common-server/src/main/java/com/netflix/metacat/common/server/partition/util/FilterPartition.java @@ -18,6 +18,7 @@ import com.netflix.metacat.common.server.partition.parser.PartitionParser; import com.netflix.metacat.common.server.partition.parser.TokenMgrError; import com.netflix.metacat.common.server.partition.visitor.PartitionParserEval; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import lombok.extern.slf4j.Slf4j; import java.io.IOException; @@ -40,6 +41,7 @@ public class FilterPartition { * @return true if the expression evaluates to true * @throws IOException exception */ + public boolean evaluatePartitionExpression(final String partitionExpression, final String name, final String path) throws IOException { return evaluatePartitionExpression(partitionExpression, name, path, false, null); @@ -54,6 +56,7 @@ public boolean evaluatePartitionExpression(final String partitionExpression, fin * @param values map of values * @return true if the expression evaluates to true */ + @SuppressFBWarnings(value = "DCN_NULLPOINTER_EXCEPTION", justification = "keep the original logic") public boolean evaluatePartitionExpression(final String partitionExpression, final String name, final String path, final boolean batchid, final Map values) { if (partitionExpression != null) { diff --git a/metacat-common/build.gradle b/metacat-common/build.gradle index e69ffc513..8fc4053e4 100644 --- a/metacat-common/build.gradle +++ b/metacat-common/build.gradle @@ -20,15 +20,15 @@ dependencies { * API Dependencies *******************************/ - compile("com.fasterxml.jackson.core:jackson-databind") - compile("com.github.fge:json-patch") - compile("io.swagger:swagger-annotations") + api("com.fasterxml.jackson.core:jackson-databind") + api("com.github.fge:json-patch") + api("io.swagger:swagger-annotations") /******************************* * Implementation Dependencies *******************************/ - compile("com.google.guava:guava") + implementation("com.google.guava:guava") /******************************* * Provided Dependencies @@ -42,6 +42,7 @@ dependencies { * Test Dependencies *******************************/ - testCompile("nl.jqno.equalsverifier:equalsverifier") - testCompile("org.apache.commons:commons-lang3") + testImplementation("nl.jqno.equalsverifier:equalsverifier") + testImplementation("org.apache.commons:commons-lang3") + testImplementation 'org.reflections:reflections:0.9.12' } diff --git a/metacat-common/src/main/java/com/netflix/metacat/common/type/TypeRegistry.java b/metacat-common/src/main/java/com/netflix/metacat/common/type/TypeRegistry.java index 77b289099..31598edec 100644 --- a/metacat-common/src/main/java/com/netflix/metacat/common/type/TypeRegistry.java +++ b/metacat-common/src/main/java/com/netflix/metacat/common/type/TypeRegistry.java @@ -19,6 +19,7 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.List; import java.util.concurrent.ConcurrentHashMap; @@ -68,6 +69,7 @@ private TypeRegistry() { addParametricType(VarcharType.VARCHAR); } + @SuppressFBWarnings(value = "MS_EXPOSE_REP", justification = "disable errors from MS_EXPOSE_REP ") public static TypeRegistry getTypeRegistry() { return INSTANCE; } diff --git a/metacat-common/src/test/groovy/com/netflix/metacat/common/dto/DtoVerificationSpec.groovy b/metacat-common/src/test/groovy/com/netflix/metacat/common/dto/DtoVerificationSpec.groovy index b38a36869..14f9acc9c 100644 --- a/metacat-common/src/test/groovy/com/netflix/metacat/common/dto/DtoVerificationSpec.groovy +++ b/metacat-common/src/test/groovy/com/netflix/metacat/common/dto/DtoVerificationSpec.groovy @@ -23,27 +23,28 @@ import org.apache.commons.lang3.RandomStringUtils import org.apache.commons.lang3.SerializationUtils import spock.lang.Specification import spock.lang.Unroll - import java.beans.Introspector import java.beans.PropertyDescriptor import java.lang.reflect.* +import org.reflections.Reflections +import org.reflections.scanners.SubTypesScanner +import java.util.stream.Collectors class DtoVerificationSpec extends Specification { private static final Random rand = new Random() - private static final ClassPath classPath = ClassPath.from(BaseDto.class.classLoader) + private static final Reflections reflections = new Reflections(BaseDto.class.package.name, new SubTypesScanner(false)) private static final MetacatJson metacatJson = new MetacatJsonLocator() public static Set> getDtoClasses() { - return classPath.getTopLevelClassesRecursive(BaseDto.class.package.name).collect { ClassPath.ClassInfo info -> - return info.load() - }.findAll { Class theClass -> + def classes = reflections.getSubTypesOf(Object.class).stream().filter {theClass -> int modifiers = theClass.modifiers - return theClass.name.endsWith('Dto') && - Modifier.isPublic(modifiers) && - !Modifier.isAbstract(modifiers) && - !Modifier.isInterface(modifiers) - } + Modifier.isPublic(modifiers) && + !Modifier.isAbstract(modifiers) && + !Modifier.isInterface(modifiers) + }.collect(Collectors.toSet()) + + return classes } public static Set> getHasDataMetadataClasses() { diff --git a/metacat-connector-cassandra/build.gradle b/metacat-connector-cassandra/build.gradle index 2e8812480..eaba653c4 100644 --- a/metacat-connector-cassandra/build.gradle +++ b/metacat-connector-cassandra/build.gradle @@ -21,10 +21,10 @@ dependencies { * Compile Dependencies *******************************/ - compile(project(":metacat-common-server")) + implementation(project(":metacat-common-server")) - compile("com.datastax.cassandra:cassandra-driver-core") - compile("com.google.inject:guice") + implementation("com.datastax.cassandra:cassandra-driver-core") + implementation("com.google.inject:guice") /******************************* * Provided Dependencies diff --git a/metacat-connector-druid/build.gradle b/metacat-connector-druid/build.gradle index b6608d2f6..d39ff3b6f 100644 --- a/metacat-connector-druid/build.gradle +++ b/metacat-connector-druid/build.gradle @@ -21,10 +21,10 @@ dependencies { * Compile Dependencies *******************************/ - compile(project(":metacat-common-server")) - compile("org.springframework:spring-web") - compile("org.apache.httpcomponents:httpclient") - compile("org.json:json") + implementation(project(":metacat-common-server")) + implementation("org.springframework:spring-web") + implementation("org.apache.httpcomponents:httpclient") + implementation("org.json:json") /******************************* * Provided Dependencies diff --git a/metacat-connector-hive/build.gradle b/metacat-connector-hive/build.gradle index 7e5dc1087..3bacbfbfc 100644 --- a/metacat-connector-hive/build.gradle +++ b/metacat-connector-hive/build.gradle @@ -21,17 +21,17 @@ dependencies { * Compile Dependencies *******************************/ - compile(project(":metacat-common-server")) + implementation(project(":metacat-common-server")) - compile("org.apache.hive:hive-metastore") - compile("org.apache.hive:hive-exec:${hive_version}:core@jar") - compile("org.apache.hadoop:hadoop-core") - compile("com.github.rholder:guava-retrying") { + implementation("org.apache.hive:hive-metastore") + implementation("org.apache.hive:hive-exec:${hive_version}:core@jar") + implementation("org.apache.hadoop:hadoop-core") + implementation("com.github.rholder:guava-retrying") { exclude module: "guava" } - compile("commons-dbutils:commons-dbutils") - compile("org.apache.iceberg:iceberg-spark-runtime") + implementation("commons-dbutils:commons-dbutils") + implementation("org.apache.iceberg:iceberg-spark-runtime") /******************************* * Provided Dependencies *******************************/ @@ -40,11 +40,11 @@ dependencies { * Runtime Dependencies *******************************/ - runtime("mysql:mysql-connector-java") + runtimeOnly("mysql:mysql-connector-java") /******************************* * Test Dependencies *******************************/ - testCompile(project(":metacat-testdata-provider")) + testImplementation(project(":metacat-testdata-provider")) } diff --git a/metacat-connector-hive/src/main/java/com/netflix/metacat/connector/hive/converters/HiveConnectorInfoConverter.java b/metacat-connector-hive/src/main/java/com/netflix/metacat/connector/hive/converters/HiveConnectorInfoConverter.java index e669593de..1b2f02b0f 100644 --- a/metacat-connector-hive/src/main/java/com/netflix/metacat/connector/hive/converters/HiveConnectorInfoConverter.java +++ b/metacat-connector-hive/src/main/java/com/netflix/metacat/connector/hive/converters/HiveConnectorInfoConverter.java @@ -33,6 +33,7 @@ import com.netflix.metacat.connector.hive.iceberg.IcebergTableWrapper; import com.netflix.metacat.connector.hive.sql.DirectSqlTable; import com.netflix.metacat.connector.hive.util.HiveTableUtil; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hive.metastore.TableType; @@ -217,6 +218,7 @@ public TableInfo fromIcebergTableToTableInfo(final QualifiedName name, * @return connector table */ @Override + @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF", justification = "false positive") public Table fromTableInfo(final TableInfo tableInfo) { final QualifiedName name = tableInfo.getName(); final String tableName = (name != null) ? name.getTableName() : ""; diff --git a/metacat-connector-hive/src/main/java/com/netflix/metacat/connector/hive/metastore/MetacatHMSHandler.java b/metacat-connector-hive/src/main/java/com/netflix/metacat/connector/hive/metastore/MetacatHMSHandler.java index d991810be..d091c4186 100644 --- a/metacat-connector-hive/src/main/java/com/netflix/metacat/connector/hive/metastore/MetacatHMSHandler.java +++ b/metacat-connector-hive/src/main/java/com/netflix/metacat/connector/hive/metastore/MetacatHMSHandler.java @@ -30,7 +30,6 @@ import org.apache.hadoop.hive.metastore.RawStoreProxy; import org.apache.hadoop.hive.metastore.Warehouse; import org.apache.hadoop.hive.metastore.api.AlreadyExistsException; -import org.apache.hadoop.hive.metastore.api.EnvironmentContext; import org.apache.hadoop.hive.metastore.api.InvalidInputException; import org.apache.hadoop.hive.metastore.api.InvalidObjectException; import org.apache.hadoop.hive.metastore.api.MetaException; @@ -265,6 +264,8 @@ public boolean equals(final Object obj) { * @throws TException any internal exception */ @SuppressWarnings({"checkstyle:methodname"}) + @Override + @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF", justification = "false positive") public boolean add_drop_partitions(final String databaseName, final String tableName, final List addParts, final List> dropParts, final boolean deleteData) @@ -283,7 +284,7 @@ public boolean add_drop_partitions(final String databaseName, boolean ret = false; Exception ex = null; try { - ret = addDropPartitionsCore(getMS(), databaseName, tableName, addParts, dropParts, false, null); + ret = addDropPartitionsCore(getMS(), databaseName, tableName, addParts, dropParts, false); } catch (Exception e) { ex = e; if (e instanceof MetaException) { @@ -306,7 +307,7 @@ public boolean add_drop_partitions(final String databaseName, private boolean addDropPartitionsCore( final RawStore ms, final String databaseName, final String tableName, final List addParts, - final List> dropParts, final boolean ifNotExists, final EnvironmentContext envContext) + final List> dropParts, final boolean ifNotExists) throws MetaException, InvalidObjectException, NoSuchObjectException, AlreadyExistsException, IOException, InvalidInputException, TException { logInfo("add_drop_partitions : db=" + databaseName + " tbl=" + tableName); diff --git a/metacat-connector-jdbc/build.gradle b/metacat-connector-jdbc/build.gradle index 9af768429..6b9cf372b 100644 --- a/metacat-connector-jdbc/build.gradle +++ b/metacat-connector-jdbc/build.gradle @@ -21,9 +21,9 @@ dependencies { * Compile Dependencies *******************************/ - compile(project(":metacat-common-server")) + api(project(":metacat-common-server")) - compile("com.google.inject:guice") + implementation("com.google.inject:guice") /******************************* * Provided Dependencies diff --git a/metacat-connector-mysql/build.gradle b/metacat-connector-mysql/build.gradle index 690c8a80b..85ea9d337 100644 --- a/metacat-connector-mysql/build.gradle +++ b/metacat-connector-mysql/build.gradle @@ -21,9 +21,9 @@ dependencies { * Compile Dependencies *******************************/ - compile(project(":metacat-connector-jdbc")) + implementation(project(":metacat-connector-jdbc")) - compile("com.google.inject:guice") + implementation("com.google.inject:guice") /******************************* * Provided Dependencies @@ -33,7 +33,7 @@ dependencies { * Runtime Dependencies *******************************/ - runtime("mysql:mysql-connector-java") + runtimeOnly("mysql:mysql-connector-java") /******************************* * Test Dependencies diff --git a/metacat-connector-pig/build.gradle b/metacat-connector-pig/build.gradle index ae1957b1a..377f496dd 100644 --- a/metacat-connector-pig/build.gradle +++ b/metacat-connector-pig/build.gradle @@ -21,13 +21,13 @@ dependencies { * Compile Dependencies *******************************/ - compile(project(":metacat-common-server")) + implementation(project(":metacat-common-server")) - compile("com.google.guava:guava") - compile("com.google.inject:guice") - compile("org.apache.pig:pig") - compile("org.apache.hadoop:hadoop-core") - compile("org.slf4j:slf4j-api") + implementation("com.google.guava:guava") + implementation("com.google.inject:guice") + implementation("org.apache.pig:pig") + implementation("org.apache.hadoop:hadoop-core") + implementation("org.slf4j:slf4j-api") /******************************* * Provided Dependencies diff --git a/metacat-connector-polaris/build.gradle b/metacat-connector-polaris/build.gradle index 74a21b56b..965041d83 100644 --- a/metacat-connector-polaris/build.gradle +++ b/metacat-connector-polaris/build.gradle @@ -32,14 +32,14 @@ dependencies { /******************************* * Compile Dependencies *******************************/ - compile(project(":metacat-connector-hive")) - compile(project(":metacat-connector-jdbc")) - compile(project(":metacat-common-server")) - compile('org.springframework.data:spring-data-jpa') - compile('org.springframework.boot:spring-boot-starter-aop') - compile('org.springframework.retry:spring-retry') - compile("org.springframework:spring-aspects") - compile("com.h2database:h2") + implementation(project(":metacat-connector-hive")) + implementation(project(":metacat-connector-jdbc")) + implementation(project(":metacat-common-server")) + implementation('org.springframework.data:spring-data-jpa') + implementation('org.springframework.boot:spring-boot-starter-aop') + implementation('org.springframework.retry:spring-retry') + implementation("org.springframework:spring-aspects") + implementation("com.h2database:h2") /******************************* * Provided Dependencies @@ -55,13 +55,13 @@ dependencies { /******************************* * Test Dependencies *******************************/ - testCompile('org.springframework:spring-test') + testImplementation('org.springframework:spring-test') testImplementation('org.springframework.boot:spring-boot-starter-test') { exclude group: 'com.vaadin.external.google', module: 'android-json' } testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1' - testCompile("org.junit.jupiter:junit-jupiter-api:5.4.2") + testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.2") testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.2") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.4.2") testRuntimeOnly "org.junit.platform:junit-platform-commons:1.7.0" @@ -81,14 +81,14 @@ test { task startCrdbCluster(type: Exec) { commandLine '/bin/echo', project.file('src/functionalTest/scripts/start_docker_containers.sh') commandLine 'sh', - project.file('src/functionalTest/scripts/start_docker_containers.sh'), - project.file('src/functionalTest/scripts/docker-compose.yml') + project.file('src/functionalTest/scripts/start_docker_containers.sh'), + project.file('src/functionalTest/scripts/docker-compose.yml') } task stopCrdbCluster(type: Exec) { - commandLine 'sh', - project.file('src/functionalTest/scripts/stop_docker_containers.sh'), - project.file('src/functionalTest/scripts/docker-compose.yml') + commandLine 'sh', + project.file('src/functionalTest/scripts/stop_docker_containers.sh'), + project.file('src/functionalTest/scripts/docker-compose.yml') } functionalTest { diff --git a/metacat-connector-polaris/src/main/java/com/netflix/metacat/connector/polaris/PolarisConnectorTableService.java b/metacat-connector-polaris/src/main/java/com/netflix/metacat/connector/polaris/PolarisConnectorTableService.java index ce54dfd57..31138fc22 100644 --- a/metacat-connector-polaris/src/main/java/com/netflix/metacat/connector/polaris/PolarisConnectorTableService.java +++ b/metacat-connector-polaris/src/main/java/com/netflix/metacat/connector/polaris/PolarisConnectorTableService.java @@ -29,7 +29,7 @@ import com.netflix.metacat.connector.polaris.store.entities.PolarisTableEntity; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.MapUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.cache.annotation.Cacheable; import org.springframework.dao.DataIntegrityViolationException; diff --git a/metacat-connector-polaris/src/main/java/com/netflix/metacat/connector/polaris/mappers/PolarisTableMapper.java b/metacat-connector-polaris/src/main/java/com/netflix/metacat/connector/polaris/mappers/PolarisTableMapper.java index 0396cd1fb..75e00fe62 100644 --- a/metacat-connector-polaris/src/main/java/com/netflix/metacat/connector/polaris/mappers/PolarisTableMapper.java +++ b/metacat-connector-polaris/src/main/java/com/netflix/metacat/connector/polaris/mappers/PolarisTableMapper.java @@ -9,7 +9,7 @@ import com.netflix.metacat.connector.hive.sql.DirectSqlTable; import com.netflix.metacat.connector.polaris.store.entities.PolarisTableEntity; import org.apache.commons.collections.MapUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.sql.Date; import java.util.Map; diff --git a/metacat-connector-polaris/src/main/java/com/netflix/metacat/connector/polaris/store/PolarisStoreConnector.java b/metacat-connector-polaris/src/main/java/com/netflix/metacat/connector/polaris/store/PolarisStoreConnector.java index c4a28bdec..5c3b203e9 100644 --- a/metacat-connector-polaris/src/main/java/com/netflix/metacat/connector/polaris/store/PolarisStoreConnector.java +++ b/metacat-connector-polaris/src/main/java/com/netflix/metacat/connector/polaris/store/PolarisStoreConnector.java @@ -6,7 +6,6 @@ import com.netflix.metacat.connector.polaris.store.repos.PolarisDatabaseRepository; import com.netflix.metacat.connector.polaris.store.repos.PolarisTableRepository; import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; @@ -23,7 +22,7 @@ * This class exposes APIs for CRUD operations. */ @Transactional(rollbackFor = Exception.class) -@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@RequiredArgsConstructor public class PolarisStoreConnector implements PolarisStoreService { private final PolarisDatabaseRepository dbRepo; private final PolarisTableRepository tblRepo; diff --git a/metacat-connector-postgresql/build.gradle b/metacat-connector-postgresql/build.gradle index d35d7e9af..04f72bfb0 100644 --- a/metacat-connector-postgresql/build.gradle +++ b/metacat-connector-postgresql/build.gradle @@ -21,9 +21,9 @@ dependencies { * Compile Dependencies *******************************/ - compile(project(":metacat-connector-jdbc")) - - compile("com.google.inject:guice") + implementation(project(":metacat-connector-jdbc")) + + implementation("com.google.inject:guice") /******************************* * Provided Dependencies @@ -33,7 +33,7 @@ dependencies { * Runtime Dependencies *******************************/ - runtime("org.postgresql:postgresql") + runtimeOnly("org.postgresql:postgresql") /******************************* * Test Dependencies diff --git a/metacat-connector-redshift/build.gradle b/metacat-connector-redshift/build.gradle index 9773c7512..342047f4f 100644 --- a/metacat-connector-redshift/build.gradle +++ b/metacat-connector-redshift/build.gradle @@ -21,9 +21,9 @@ dependencies { * Compile Dependencies *******************************/ - compile(project(":metacat-connector-jdbc")) + implementation(project(":metacat-connector-jdbc")) - compile("com.google.inject:guice") + implementation("com.google.inject:guice") /******************************* * Provided Dependencies @@ -33,7 +33,7 @@ dependencies { * Runtime Dependencies *******************************/ - runtime("com.amazon.redshift:redshift-jdbc42") + runtimeOnly("com.amazon.redshift:redshift-jdbc42") /******************************* * Test Dependencies diff --git a/metacat-connector-s3/build.gradle b/metacat-connector-s3/build.gradle index 5a0748c7f..80ab204e6 100644 --- a/metacat-connector-s3/build.gradle +++ b/metacat-connector-s3/build.gradle @@ -21,16 +21,16 @@ dependencies { * Compile Dependencies *******************************/ - compile(project(":metacat-common-server")) - compile(project(":metacat-connector-pig")) + implementation(project(":metacat-common-server")) + implementation(project(":metacat-connector-pig")) - compile("com.google.guava:guava") - compile("com.google.inject:guice") - compile("com.google.inject.extensions:guice-persist") - compile("com.google.inject.extensions:guice-multibindings") - compile("com.google.inject.extensions:guice-servlet") - compile("joda-time:joda-time") - compile("org.hibernate:hibernate-entitymanager") + implementation("com.google.guava:guava") + implementation("com.google.inject:guice") + implementation("com.google.inject.extensions:guice-persist") + implementation("com.google.inject.extensions:guice-multibindings") + implementation("com.google.inject.extensions:guice-servlet") + implementation("joda-time:joda-time:2.10.10") + implementation("org.hibernate:hibernate-entitymanager") /******************************* * Provided Dependencies @@ -40,7 +40,7 @@ dependencies { * Runtime Dependencies *******************************/ - runtime("mysql:mysql-connector-java") + runtimeOnly("mysql:mysql-connector-java") /******************************* * Test Dependencies diff --git a/metacat-connector-snowflake/build.gradle b/metacat-connector-snowflake/build.gradle index 4251f7281..a8087d00a 100644 --- a/metacat-connector-snowflake/build.gradle +++ b/metacat-connector-snowflake/build.gradle @@ -21,9 +21,9 @@ dependencies { * Compile Dependencies *******************************/ - compile(project(":metacat-connector-jdbc")) + implementation(project(":metacat-connector-jdbc")) - compile("com.google.inject:guice") + implementation("com.google.inject:guice") /******************************* * Provided Dependencies @@ -33,7 +33,7 @@ dependencies { * Runtime Dependencies *******************************/ - runtime("net.snowflake:snowflake-jdbc") + runtimeOnly("net.snowflake:snowflake-jdbc") /******************************* * Test Dependencies diff --git a/metacat-functional-tests/build.gradle b/metacat-functional-tests/build.gradle index a8a43134e..3d64cc971 100644 --- a/metacat-functional-tests/build.gradle +++ b/metacat-functional-tests/build.gradle @@ -61,17 +61,17 @@ dependencies { *******************************/ // Test that metacat-client can be used with jersey 1 - testCompile(project(":metacat-common-server")) - testCompile(project(":metacat-connector-hive")) - testCompile(project(":metacat-testdata-provider")) + testImplementation(project(":metacat-common-server")) + testImplementation(project(":metacat-connector-hive")) + testImplementation(project(":metacat-testdata-provider")) - functionalTestCompile(project(":metacat-client")) - functionalTestCompile("org.apache.hadoop:hadoop-core") - functionalTestCompile("org.apache.hive:hive-exec:${hive_version}") { + functionalTestImplementation(project(":metacat-client")) + functionalTestImplementation("org.apache.hadoop:hadoop-core") + functionalTestImplementation("org.apache.hive:hive-exec:${hive_version}") { exclude module: "pentaho-aggdesigner-algorithm" } - testCompile("org.skyscreamer:jsonassert") + testImplementation("org.skyscreamer:jsonassert") } task expandWar(type: Copy) { diff --git a/metacat-main/build.gradle b/metacat-main/build.gradle index 066f3e878..1b738b399 100644 --- a/metacat-main/build.gradle +++ b/metacat-main/build.gradle @@ -27,32 +27,32 @@ dependencies { * API Dependencies *******************************/ - compile(project(":metacat-common")) - compile(project(":metacat-common-server")) - compile(project(":metacat-thrift")) - compile("org.elasticsearch.client:transport") + api(project(":metacat-common")) + api(project(":metacat-common-server")) + api(project(":metacat-thrift")) + api("org.elasticsearch.client:transport") - compile("com.amazonaws:aws-java-sdk-sns") - compile("joda-time:joda-time") + api("com.amazonaws:aws-java-sdk-sns") + api("joda-time:joda-time") /******************************* * Implementation Dependencies *******************************/ - compile(project(":metacat-metadata-mysql")) + implementation(project(":metacat-metadata-mysql")) - compile("com.google.guava:guava") - compile("com.github.rholder:guava-retrying") { + implementation("com.google.guava:guava") + implementation("com.github.rholder:guava-retrying") { exclude module: "guava" } - compile("io.springfox:springfox-boot-starter") - compile("org.springframework.boot:spring-boot-starter") - compile("org.springframework.boot:spring-boot-starter-web") - compile("org.springframework.boot:spring-boot-starter-actuator") - compile("org.springframework.boot:spring-boot-starter-hateoas") - compile("org.springframework.boot:spring-boot-starter-logging") - compile("org.springframework.boot:spring-boot-starter-tomcat") - compile("javax.validation:validation-api") + implementation("io.springfox:springfox-boot-starter") + implementation("org.springframework.boot:spring-boot-starter") + implementation("org.springframework.boot:spring-boot-starter-web") + implementation("org.springframework.boot:spring-boot-starter-actuator") + implementation("org.springframework.boot:spring-boot-starter-hateoas") + implementation("org.springframework.boot:spring-boot-starter-logging") + implementation("org.springframework.boot:spring-boot-starter-tomcat") + implementation("javax.validation:validation-api") implementation 'io.springfox:springfox-boot-starter' /******************************* @@ -65,30 +65,30 @@ dependencies { * Runtime Dependencies *******************************/ - runtime(project(":metacat-connector-cassandra")) - runtime(project(":metacat-connector-hive")) - runtime(project(":metacat-connector-polaris")) - runtime(project(":metacat-metadata")) - runtime(project(":metacat-connector-mysql")) - runtime(project(":metacat-connector-postgresql")) - runtime(project(":metacat-connector-redshift")) - runtime(project(":metacat-connector-snowflake")) - runtime(project(":metacat-connector-s3")) - runtime(project(":metacat-connector-druid")) - - runtime("io.springfox:springfox-swagger-ui") - runtime("org.webjars:hal-browser:3325375") - runtime("org.springframework:spring-aspects") - runtime("org.apache.logging.log4j:log4j-core") - runtime("mysql:mysql-connector-java:8.0.27") + runtimeOnly(project(":metacat-connector-cassandra")) + runtimeOnly(project(":metacat-connector-hive")) + runtimeOnly(project(":metacat-connector-polaris")) + runtimeOnly(project(":metacat-metadata")) + runtimeOnly(project(":metacat-connector-mysql")) + runtimeOnly(project(":metacat-connector-postgresql")) + runtimeOnly(project(":metacat-connector-redshift")) + runtimeOnly(project(":metacat-connector-snowflake")) + runtimeOnly(project(":metacat-connector-s3")) + runtimeOnly(project(":metacat-connector-druid")) + + runtimeOnly("io.springfox:springfox-swagger-ui") + runtimeOnly("org.webjars:hal-browser:3325375") + runtimeOnly("org.springframework:spring-aspects") + runtimeOnly("org.apache.logging.log4j:log4j-core") + runtimeOnly("mysql:mysql-connector-java:8.0.27") /******************************* * Test Dependencies *******************************/ - testCompile(project(":metacat-testdata-provider")) - testCompile("io.airlift:testing-mysql-server") - testCompile("org.apache.logging.log4j:log4j-core") + testImplementation(project(":metacat-testdata-provider")) + testImplementation("io.airlift:testing-mysql-server") + testImplementation("org.apache.logging.log4j:log4j-core") } diff --git a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/MetacatController.java b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/MetacatController.java index 51af5419d..6ad96130f 100644 --- a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/MetacatController.java +++ b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/MetacatController.java @@ -46,7 +46,6 @@ import io.swagger.annotations.ApiResponses; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.DependsOn; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -82,7 +81,7 @@ ) @Slf4j @DependsOn("metacatCoreInitService") -@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@RequiredArgsConstructor public class MetacatController implements MetacatV1 { private final CatalogService catalogService; private final DatabaseService databaseService; diff --git a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/MetadataController.java b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/MetadataController.java index a0a083bb8..fdd58adac 100644 --- a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/MetadataController.java +++ b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/MetadataController.java @@ -36,7 +36,6 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.DependsOn; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -69,7 +68,7 @@ consumes = MediaType.APPLICATION_JSON_VALUE ) @DependsOn("metacatCoreInitService") -@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@RequiredArgsConstructor public class MetadataController { private final UserMetadataService userMetadataService; private final MetacatServiceHelper helper; diff --git a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/PartitionController.java b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/PartitionController.java index 29f47b603..5ed9b07af 100644 --- a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/PartitionController.java +++ b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/PartitionController.java @@ -36,7 +36,6 @@ import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.DependsOn; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -71,7 +70,7 @@ consumes = MediaType.APPLICATION_JSON_VALUE ) @DependsOn("metacatCoreInitService") -@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@RequiredArgsConstructor public class PartitionController implements PartitionV1 { private final MetacatController v1; diff --git a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/ResolverController.java b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/ResolverController.java index e8bd97629..bd4b69860 100644 --- a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/ResolverController.java +++ b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/ResolverController.java @@ -26,7 +26,6 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.DependsOn; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -55,7 +54,7 @@ consumes = MediaType.APPLICATION_JSON_VALUE ) @DependsOn("metacatCoreInitService") -@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@RequiredArgsConstructor public class ResolverController { private final TableService tableService; private final PartitionService partitionService; diff --git a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/SearchController.java b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/SearchController.java index f9c335749..4db3f7dbf 100644 --- a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/SearchController.java +++ b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/SearchController.java @@ -22,7 +22,6 @@ import com.netflix.metacat.main.services.search.ElasticSearchUtil; import io.swagger.annotations.ApiParam; import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.DependsOn; import org.springframework.http.HttpStatus; @@ -45,7 +44,7 @@ produces = MediaType.APPLICATION_JSON_VALUE ) @DependsOn("metacatCoreInitService") -@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@RequiredArgsConstructor public class SearchController { private final ElasticSearchUtil elasticSearchUtil; private final RequestWrapper requestWrapper; diff --git a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/TagController.java b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/TagController.java index 4c5e50fb9..e602be85e 100644 --- a/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/TagController.java +++ b/metacat-main/src/main/java/com/netflix/metacat/main/api/v1/TagController.java @@ -42,7 +42,6 @@ import io.swagger.annotations.ApiResponses; import lombok.NonNull; import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.DependsOn; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -81,7 +80,7 @@ consumes = MediaType.APPLICATION_JSON_VALUE ) @DependsOn("metacatCoreInitService") -@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@RequiredArgsConstructor public class TagController { private final RequestWrapper requestWrapper; diff --git a/metacat-metadata-mysql/build.gradle b/metacat-metadata-mysql/build.gradle index dfacf414d..3ca5a211c 100644 --- a/metacat-metadata-mysql/build.gradle +++ b/metacat-metadata-mysql/build.gradle @@ -21,17 +21,17 @@ dependencies { * API Dependencies *******************************/ - compile(project(":metacat-common")) - compile(project(":metacat-common-server")) + api(project(":metacat-common")) + api(project(":metacat-common-server")) /******************************* * Implementation Dependencies *******************************/ - compile("commons-dbutils:commons-dbutils") - compile("com.google.guava:guava") - compile("org.apache.tomcat:tomcat-jdbc") - compile("org.slf4j:slf4j-api") + implementation("commons-dbutils:commons-dbutils") + implementation("com.google.guava:guava") + implementation("org.apache.tomcat:tomcat-jdbc") + implementation("org.slf4j:slf4j-api") /******************************* * Provided Dependencies *******************************/ @@ -40,16 +40,16 @@ dependencies { * Runtime Dependencies *******************************/ - runtime("mysql:mysql-connector-java") + runtimeOnly("mysql:mysql-connector-java") /******************************* * Test Dependencies *******************************/ - testCompile("io.airlift:testing-mysql-server") { + testImplementation("io.airlift:testing-mysql-server") { exclude module:"bval-jsr303" exclude module:"validation-api" } - testCompile(project(":metacat-testdata-provider")) - testCompile("commons-logging:commons-logging") + testImplementation(project(":metacat-testdata-provider")) + testImplementation("commons-logging:commons-logging") } diff --git a/metacat-metadata/build.gradle b/metacat-metadata/build.gradle index d45fb83ad..9b226d17d 100644 --- a/metacat-metadata/build.gradle +++ b/metacat-metadata/build.gradle @@ -32,10 +32,10 @@ dependencies { /******************************* * Compile Dependencies *******************************/ - compile(project(":metacat-connector-jdbc")) - compile(project(":metacat-common-server")) - compile('org.springframework.data:spring-data-jpa') - compile("com.h2database:h2") + implementation(project(":metacat-connector-jdbc")) + implementation(project(":metacat-common-server")) + implementation('org.springframework.data:spring-data-jpa') + implementation("com.h2database:h2") /******************************* * Provided Dependencies @@ -51,11 +51,11 @@ dependencies { /******************************* * Test Dependencies *******************************/ - testCompile('org.springframework:spring-test') + testImplementation('org.springframework:spring-test') testImplementation('org.springframework.boot:spring-boot-starter-test') testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1' - testCompile("org.junit.jupiter:junit-jupiter-api:5.4.2") + testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.2") testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.2") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.4.2") testRuntimeOnly "org.junit.platform:junit-platform-commons:1.7.0" @@ -75,14 +75,14 @@ test { task startCrdbCluster(type: Exec) { commandLine '/bin/echo', project.file('src/functionalTest/scripts/start_docker_containers.sh') commandLine 'sh', - project.file('src/functionalTest/scripts/start_docker_containers.sh'), - project.file('src/functionalTest/scripts/docker-compose.yml') + project.file('src/functionalTest/scripts/start_docker_containers.sh'), + project.file('src/functionalTest/scripts/docker-compose.yml') } task stopCrdbCluster(type: Exec) { - commandLine 'sh', - project.file('src/functionalTest/scripts/stop_docker_containers.sh'), - project.file('src/functionalTest/scripts/docker-compose.yml') + commandLine 'sh', + project.file('src/functionalTest/scripts/stop_docker_containers.sh'), + project.file('src/functionalTest/scripts/docker-compose.yml') } functionalTest { diff --git a/metacat-testdata-provider/build.gradle b/metacat-testdata-provider/build.gradle index b1f26078a..313ebf03c 100644 --- a/metacat-testdata-provider/build.gradle +++ b/metacat-testdata-provider/build.gradle @@ -21,10 +21,10 @@ dependencies { * Compile Dependencies *******************************/ - compile(project(":metacat-common")) - compile(project(":metacat-common-server")) + implementation(project(":metacat-common")) + implementation(project(":metacat-common-server")) - compile("org.codehaus.groovy:groovy-all") + implementation("org.codehaus.groovy:groovy-all") /******************************* * Provided Dependencies diff --git a/metacat-thrift/build.gradle b/metacat-thrift/build.gradle index 67262aa0c..e23dce9f5 100644 --- a/metacat-thrift/build.gradle +++ b/metacat-thrift/build.gradle @@ -21,18 +21,18 @@ dependencies { * API Dependencies *******************************/ - compile(project(":metacat-common")) - compile(project(":metacat-common-server")) + api(project(":metacat-common")) + api(project(":metacat-common-server")) - compile("org.apache.hadoop:hadoop-core") - compile("org.apache.hive:hive-metastore") - compile("org.apache.hive:hive-exec:${hive_version}:core@jar") - runtime("com.esotericsoftware.kryo:kryo") + api("org.apache.hadoop:hadoop-core") + api("org.apache.hive:hive-metastore") + api("org.apache.hive:hive-exec:${hive_version}:core@jar") + runtimeOnly("com.esotericsoftware.kryo:kryo") /******************************* * Implementation Dependencies *******************************/ - compile("com.google.guava:guava") + implementation("com.google.guava:guava") /******************************* * Provided Dependencies @@ -46,7 +46,7 @@ dependencies { * Test Dependencies *******************************/ - testCompile("de.danielbechler:java-object-diff") + testImplementation("de.danielbechler:java-object-diff") } // TODO: Remove this once we optimize this task. It running out of memory at times. diff --git a/metacat-war/build.gradle b/metacat-war/build.gradle index 92a9710d0..fa0662bb7 100644 --- a/metacat-war/build.gradle +++ b/metacat-war/build.gradle @@ -29,10 +29,11 @@ dependencies { *******************************/ // TODO: Fix dependencies - compile(project(":metacat-common")) - compile(project(":metacat-common-server")) - compile(project(":metacat-main")) - compile(project(":metacat-metadata-mysql")) + implementation(project(":metacat-common")) + implementation(project(":metacat-common-server")) + implementation(project(":metacat-main")) + implementation(project(":metacat-metadata-mysql")) + implementation 'org.springframework:spring-web' /******************************* * Provided Dependencies @@ -44,7 +45,7 @@ dependencies { * Runtime Dependencies *******************************/ - runtime("org.springframework:spring-aspects") + runtimeOnly("org.springframework:spring-aspects") /******************************* * Test Dependencies @@ -57,7 +58,7 @@ task(console, dependsOn: "testClasses", type: JavaExec) { } war { - baseName = "metacat" + archivesBaseName = "metacat" doLast{ copy{ from(war.archivePath) {