diff --git a/build.gradle b/build.gradle index e12a8b5..c979c6e 100644 --- a/build.gradle +++ b/build.gradle @@ -17,12 +17,11 @@ plugins { id "java" id "java-library" - id "com.google.protobuf" version "0.8.18" - id "com.diffplug.spotless" version "5.9.0" + id "com.google.protobuf" version "0.9.4" + id "com.diffplug.spotless" version "6.2.2" id "idea" id "jacoco" - id "com.github.johnrengelman.shadow" version "7.1.2" - id "maven-publish" + id "com.github.johnrengelman.shadow" version "8.1.1" } repositories { @@ -33,16 +32,17 @@ repositories { } } -def protoVersion = "3.20.1" -def beamVersion = "2.36.0" -def hadoopVersion = "3.3.1" -def autoValueVersion = "1.8.2" -def floggerVersion = "0.7.4" +def protoVersion = "3.24.4" +def beamVersion = "2.51.0" +def hadoopVersion = "3.3.6" +def autoValueVersion = "1.10.4" +def floggerVersion = "0.8" + dependencies { // Protobuf deps - compileOnly "com.google.api.grpc:proto-google-common-protos:2.7.4" + compileOnly "com.google.api.grpc:proto-google-common-protos:2.26.0" implementation "com.google.protobuf:protobuf-java:${protoVersion}" implementation "com.google.protobuf:protobuf-java-util:${protoVersion}" @@ -54,32 +54,32 @@ dependencies { testAnnotationProcessor "com.google.auto.value:auto-value:${autoValueVersion}" // Commons library deps - implementation 'com.google.guava:guava:31.0.1-jre' - implementation "org.apache.commons:commons-lang3:3.12.0" - implementation "org.apache.httpcomponents:httpclient:4.5.13" + implementation 'com.google.guava:guava:32.1.3-jre' + implementation "org.apache.commons:commons-lang3:3.13.0" + implementation "org.apache.httpcomponents:httpclient:4.5.14" // CSV Library - implementation "org.apache.commons:commons-csv:1.9.0" + implementation "org.apache.commons:commons-csv:1.10.0" // Google Services deps - implementation "com.google.cloud:google-cloud-dlp:3.1.0" - implementation "com.google.cloud:google-cloud-datacatalog:1.6.3" - implementation "com.google.cloud:google-cloud-kms:2.4.0" - implementation "com.google.cloud:google-cloud-secretmanager:2.0.7" + implementation "com.google.cloud:google-cloud-dlp:3.32.0" + implementation "com.google.cloud:google-cloud-datacatalog:1.34.0" + implementation "com.google.cloud:google-cloud-kms:2.31.0" + implementation "com.google.cloud:google-cloud-secretmanager:2.28.0" // Google Tink for encryption - implementation "com.google.crypto.tink:tink:1.6.1" - implementation "com.google.crypto.tink:tink-gcpkms:1.6.1" + implementation "com.google.crypto.tink:tink:1.11.0" + implementation "com.google.crypto.tink:tink-gcpkms:1.9.0" // JSON related libs implementation "com.github.wnameless.json:json-flattener:0.11.1" - implementation "com.jayway.jsonpath:json-path:2.7.0" + implementation "com.jayway.jsonpath:json-path:2.8.0" implementation "com.fasterxml.jackson.core:jackson-core:2.13.1" implementation "com.fasterxml.jackson.core:jackson-databind:2.13.1" // Hadoop files (Avro + Parquet) - implementation "org.apache.avro:avro:1.11.0" - implementation "org.apache.parquet:parquet-avro:1.12.1" + implementation "org.apache.avro:avro:1.11.3" + implementation "org.apache.parquet:parquet-avro:1.13.1" implementation("org.apache.hadoop:hadoop-common:${hadoopVersion}"){ exclude group: "org.slf4j", module: "slf4j-log4j12" } @@ -99,9 +99,9 @@ dependencies { runtimeOnly "org.apache.beam:beam-runners-google-cloud-dataflow-java:${beamVersion}" // Runtime only deps - runtimeOnly "org.slf4j:slf4j-api:1.7.36" - runtimeOnly "org.slf4j:slf4j-jdk14:1.7.36" - runtimeOnly "io.grpc:grpc-netty:1.44.0" + runtimeOnly "org.slf4j:slf4j-api:2.0.9" + runtimeOnly "org.slf4j:slf4j-jdk14:2.0.9" + runtimeOnly "io.grpc:grpc-netty:1.58.0" runtimeOnly ("org.apache.hadoop:hadoop-mapreduce-client-core:${hadoopVersion}") { exclude group: "org.slf4j", module: "slf4j-log4j12" @@ -111,36 +111,36 @@ dependencies { } // CloudSQL Connection Factory - runtimeOnly "com.google.cloud.sql:mysql-socket-factory-connector-j-8:1.4.4" - runtimeOnly "com.google.cloud.sql:postgres-socket-factory:1.4.4" + runtimeOnly "com.google.cloud.sql:mysql-socket-factory-connector-j-8:1.14.1" + runtimeOnly "com.google.cloud.sql:postgres-socket-factory:1.14.1" // MySQL JDBC driver - runtimeOnly('mysql:mysql-connector-java:8.0.25') { + runtimeOnly('mysql:mysql-connector-java:8.0.33') { exclude group: "com.google.protobuf", module: "protobuf-java" } - testRuntimeOnly('mysql:mysql-connector-java:8.0.25') { + testRuntimeOnly('mysql:mysql-connector-java:8.0.33') { exclude group: "com.google.protobuf", module: "protobuf-java" } // Postgres SQL JDBC Driver - runtimeOnly "org.postgresql:postgresql:42.3.2" + runtimeOnly "org.postgresql:postgresql:42.6.0" //checker-framework - compileOnly "org.checkerframework:checker-qual:3.21.2" + compileOnly "org.checkerframework:checker-qual:3.39.0" // Testing Dependencies testImplementation "junit:junit:4.13.2" testImplementation "org.hamcrest:hamcrest-all:1.3" testImplementation "org.mockito:mockito-all:1.10.19" - testImplementation "com.google.truth:truth:1.1.3" - testImplementation "com.google.truth.extensions:truth-java8-extension:1.1.3" - testImplementation "com.google.truth.extensions:truth-proto-extension:1.1.3" - testImplementation "org.skyscreamer:jsonassert:1.5.0" - testImplementation "org.apache.logging.log4j:log4j-core:2.17.0" + testImplementation "com.google.truth:truth:1.1.5" + testImplementation "com.google.truth.extensions:truth-java8-extension:1.1.5" + testImplementation "com.google.truth.extensions:truth-proto-extension:1.1.5" + testImplementation "org.skyscreamer:jsonassert:1.5.1" + testImplementation "org.apache.logging.log4j:log4j-core:2.17.2" // Testcontainers used to mock database - testImplementation "org.testcontainers:mysql:1.16.3" + testImplementation "org.testcontainers:mysql:1.19.1" } protobuf { @@ -174,16 +174,10 @@ test { } jacoco { - toolVersion = "0.8.7" + toolVersion = "0.8.9" } jacocoTestReport { - reports { - csv.enabled false - xml.enabled true - html.enabled true - } - afterEvaluate { classDirectories.setFrom(files(classDirectories.files.collect { fileTree(dir: it, exclude: [ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fc..e411586 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-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/com/google/cloud/solutions/autotokenize/common/TransformingReader.java b/src/main/java/com/google/cloud/solutions/autotokenize/common/TransformingReader.java index 04f759e..8457655 100644 --- a/src/main/java/com/google/cloud/solutions/autotokenize/common/TransformingReader.java +++ b/src/main/java/com/google/cloud/solutions/autotokenize/common/TransformingReader.java @@ -28,6 +28,7 @@ import com.google.cloud.solutions.autotokenize.AutoTokenizeMessages.JdbcConfiguration.PasswordsCase; import com.google.cloud.solutions.autotokenize.AutoTokenizeMessages.SourceType; import com.google.cloud.solutions.autotokenize.common.CsvIO.CsvParse; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import java.util.Arrays; import java.util.List; @@ -52,7 +53,6 @@ import org.apache.beam.sdk.values.PCollection; import org.apache.beam.sdk.values.PCollectionTuple; import org.apache.beam.sdk.values.TupleTag; -import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting; import org.checkerframework.checker.nullness.qual.Nullable; /** diff --git a/src/test/java/com/google/cloud/solutions/autotokenize/testing/RecordsCountMatcher.java b/src/test/java/com/google/cloud/solutions/autotokenize/testing/RecordsCountMatcher.java index 000ca79..2887c9a 100644 --- a/src/test/java/com/google/cloud/solutions/autotokenize/testing/RecordsCountMatcher.java +++ b/src/test/java/com/google/cloud/solutions/autotokenize/testing/RecordsCountMatcher.java @@ -18,8 +18,8 @@ import static com.google.common.truth.Truth.assertThat; +import com.google.common.collect.Iterables; import org.apache.beam.sdk.transforms.SerializableFunction; -import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterables; /** Utility Matcher for PAssert to check the number of items in a given PCollection. */ public class RecordsCountMatcher implements SerializableFunction, Void> {