diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 0105b7d174a..b852b44f473 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -30,7 +30,6 @@ dependencies { implementation(baselibs.jandex) implementation(baselibs.idea.ext) implementation(baselibs.shadow) - implementation(baselibs.protobuf) implementation(baselibs.errorprone) implementation(baselibs.nessie.buildsupport.reflectionconfig) diff --git a/buildSrc/src/main/kotlin/Checkstyle.kt b/buildSrc/src/main/kotlin/Checkstyle.kt index 74d9358d7e6..82ddd83bfe4 100644 --- a/buildSrc/src/main/kotlin/Checkstyle.kt +++ b/buildSrc/src/main/kotlin/Checkstyle.kt @@ -29,6 +29,10 @@ import org.gradle.kotlin.dsl.withType class NessieCheckstylePlugin : Plugin { override fun apply(project: Project): Unit = project.run { + if (project.name.endsWith("-proto")) { + return + } + apply() configure { toolVersion = libsRequiredVersion("checkstyle") diff --git a/buildSrc/src/main/kotlin/ProtobufHelperPlugin.kt b/buildSrc/src/main/kotlin/ProtobufHelperPlugin.kt deleted file mode 100644 index 8ef2dc31f28..00000000000 --- a/buildSrc/src/main/kotlin/ProtobufHelperPlugin.kt +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2022 Dremio - * - * 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. - */ - -import com.google.protobuf.gradle.ProtobufPlugin -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.api.plugins.JavaPluginExtension -import org.gradle.api.plugins.quality.Checkstyle -import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.withType - -/** Makes the generated sources available to IDEs, disables Checkstyle on generated code. */ -@Suppress("unused") -class ProtobufHelperPlugin : Plugin { - override fun apply(project: Project): Unit = - project.run { - apply() - - configure { - val sourceSets = this.sourceSets - - val sourceSetJavaMain = sourceSets.getByName("main").java - sourceSetJavaMain.srcDir(project.buildDir.resolve("generated/source/proto/main/java")) - sourceSetJavaMain.destinationDirectory.set( - project.buildDir.resolve("classes/java/generated") - ) - - val sourceSetJavaTest = sourceSets.getByName("test").java - sourceSetJavaTest.srcDir(project.buildDir.resolve("generated/source/proto/test/java")) - sourceSetJavaTest.destinationDirectory.set( - project.buildDir.resolve("classes/java/generatedTest") - ) - } - - tasks.withType(Checkstyle::class.java).configureEach { - exclude("org/projectnessie/**/*Types.java") - } - } -} diff --git a/gradle/baselibs.versions.toml b/gradle/baselibs.versions.toml index d10058df286..87e3dc9f757 100644 --- a/gradle/baselibs.versions.toml +++ b/gradle/baselibs.versions.toml @@ -4,8 +4,7 @@ errorpronePlugin = "3.0.1" jandexPlugin = "1.87" junit = "5.9.2" -nessieBuildPlugins = "0.2.20" -protobufPlugin = "0.9.2" +nessieBuildPlugins = "0.2.21" shadowPlugin = "8.1.1" spotlessPlugin = "6.17.0" @@ -21,4 +20,3 @@ junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params" } nessie-buildsupport-reflectionconfig = { module = "org.projectnessie.buildsupport:reflection-config", version.ref = "nessieBuildPlugins" } shadow = { module = "com.github.johnrengelman:shadow", version.ref = "shadowPlugin" } spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotlessPlugin" } -protobuf = { module = "com.google.protobuf:protobuf-gradle-plugin", version.ref = "protobufPlugin" } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 67d8c366fb4..74994cd2faa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -226,4 +226,5 @@ jmh = { id = "me.champeau.jmh", version = "0.7.0" } nessie-run = { id = "org.projectnessie", version = "0.29.0" } nexus-publish-plugin = { id = "io.github.gradle-nexus.publish-plugin", version = "1.3.0" } node-gradle = { id = "com.github.node-gradle.node", version = "3.5.1" } +protobuf = { id = "com.google.protobuf", version = "0.9.2" } quarkus = { id = "io.quarkus", version.ref = "quarkus" } diff --git a/gradle/projects.main.properties b/gradle/projects.main.properties index 78f655cafaa..aa41f5c9980 100644 --- a/gradle/projects.main.properties +++ b/gradle/projects.main.properties @@ -26,6 +26,7 @@ nessie-services=servers/services nessie-server-store=servers/store nessie-server-store-proto=servers/store-proto nessie-content-generator=tools/content-generator +nessie-protobuf-relocated=tools/protobuf-relocated nessie-ui=ui nessie-versioned-persist-adapter=versioned/persist/adapter nessie-versioned-persist-bench=versioned/persist/bench diff --git a/servers/quarkus-cli/build.gradle.kts b/servers/quarkus-cli/build.gradle.kts index 48370bcbbea..28ad864b0ca 100644 --- a/servers/quarkus-cli/build.gradle.kts +++ b/servers/quarkus-cli/build.gradle.kts @@ -60,8 +60,6 @@ dependencies { implementation(enforcedPlatform(libs.quarkus.amazon.services.bom)) implementation("io.quarkus:quarkus-picocli") - implementation(libs.protobuf.java) - // javax/jakarta compileOnly(libs.jakarta.annotation.api) compileOnly(libs.findbugs.jsr305) diff --git a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/BaseContentTest.java b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/BaseContentTest.java index dbb1cdf8894..82a1f6dafa8 100644 --- a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/BaseContentTest.java +++ b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/BaseContentTest.java @@ -19,7 +19,6 @@ import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.protobuf.ByteString; import io.quarkus.test.junit.main.LaunchResult; import io.quarkus.test.junit.main.QuarkusMainLauncher; import java.io.File; @@ -32,6 +31,7 @@ import org.projectnessie.model.ContentKey; import org.projectnessie.model.IcebergTable; import org.projectnessie.model.Namespace; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.CommitMetaSerializer; import org.projectnessie.versioned.persist.adapter.ContentId; diff --git a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITCheckContent.java b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITCheckContent.java index 000a0d9736e..49b3f0cfa02 100644 --- a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITCheckContent.java +++ b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITCheckContent.java @@ -21,7 +21,6 @@ import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; import static org.projectnessie.versioned.testworker.OnRefOnly.onRef; -import com.google.protobuf.ByteString; import io.quarkus.test.junit.TestProfile; import io.quarkus.test.junit.main.QuarkusMainLauncher; import io.quarkus.test.junit.main.QuarkusMainTest; @@ -33,6 +32,7 @@ import org.projectnessie.model.Content; import org.projectnessie.model.ContentKey; import org.projectnessie.model.IcebergTable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.ReferenceInfo; diff --git a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITContentInfo.java b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITContentInfo.java index a0eeb13cfa6..3ef9b190ddd 100644 --- a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITContentInfo.java +++ b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITContentInfo.java @@ -20,7 +20,6 @@ import static org.projectnessie.model.Content.Type.ICEBERG_TABLE; import static org.projectnessie.model.Content.Type.NAMESPACE; -import com.google.protobuf.ByteString; import io.quarkus.test.junit.TestProfile; import io.quarkus.test.junit.main.QuarkusMainLauncher; import io.quarkus.test.junit.main.QuarkusMainTest; @@ -31,6 +30,7 @@ import org.junit.jupiter.params.provider.ValueSource; import org.projectnessie.model.ContentKey; import org.projectnessie.model.IcebergTable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.server.store.proto.ObjectTypes; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.ReferenceInfo; diff --git a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITEraseRepository.java b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITEraseRepository.java index 89327e607ee..ab9690d390b 100644 --- a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITEraseRepository.java +++ b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITEraseRepository.java @@ -17,13 +17,13 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.google.protobuf.ByteString; import io.quarkus.test.junit.TestProfile; import io.quarkus.test.junit.main.QuarkusMainLauncher; import io.quarkus.test.junit.main.QuarkusMainTest; import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.ReferenceInfo; import org.projectnessie.versioned.ReferenceNotFoundException; diff --git a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITExportImport.java b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITExportImport.java index 69a38d80ded..1da3f3892cf 100644 --- a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITExportImport.java +++ b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITExportImport.java @@ -20,7 +20,6 @@ import static org.projectnessie.quarkus.cli.ImportRepository.ERASE_BEFORE_IMPORT; import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; -import com.google.protobuf.ByteString; import io.quarkus.test.junit.TestProfile; import io.quarkus.test.junit.main.LaunchResult; import io.quarkus.test.junit.main.QuarkusMainLauncher; @@ -39,6 +38,7 @@ import org.projectnessie.model.ContentKey; import org.projectnessie.model.IcebergTable; import org.projectnessie.model.Namespace; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.quarkus.cli.ExportRepository.Format; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.CommitMetaSerializer; diff --git a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITExportImportPersist.java b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITExportImportPersist.java index 0b2be95b60e..359eb75fe16 100644 --- a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITExportImportPersist.java +++ b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITExportImportPersist.java @@ -29,7 +29,6 @@ import static org.projectnessie.versioned.storage.common.persist.ObjId.EMPTY_OBJ_ID; import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; -import com.google.protobuf.ByteString; import io.quarkus.test.junit.TestProfile; import io.quarkus.test.junit.main.LaunchResult; import io.quarkus.test.junit.main.QuarkusMainLauncher; @@ -45,6 +44,7 @@ import org.junit.jupiter.api.io.TempDir; import org.projectnessie.api.NessieVersion; import org.projectnessie.model.IcebergTable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.quarkus.cli.ExportRepository.Format; import org.projectnessie.versioned.StoreWorker; import org.projectnessie.versioned.storage.common.indexes.StoreKey; diff --git a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITNessieInfo.java b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITNessieInfo.java index b3b531bc9dc..35c62c27bd6 100644 --- a/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITNessieInfo.java +++ b/servers/quarkus-cli/src/intTest/java/org/projectnessie/quarkus/cli/ITNessieInfo.java @@ -17,7 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.google.protobuf.ByteString; import io.quarkus.test.junit.TestProfile; import io.quarkus.test.junit.main.Launch; import io.quarkus.test.junit.main.LaunchResult; @@ -25,6 +24,7 @@ import io.quarkus.test.junit.main.QuarkusMainTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.ReferenceConflictException; diff --git a/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/CheckContent.java b/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/CheckContent.java index cf42f14142b..c877dee8dd2 100644 --- a/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/CheckContent.java +++ b/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/CheckContent.java @@ -20,7 +20,6 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -import com.google.protobuf.ByteString; import java.io.OutputStream; import java.io.PrintWriter; import java.io.StringWriter; @@ -31,6 +30,7 @@ import java.util.stream.Stream; import org.projectnessie.model.Content; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.ReferenceInfo; diff --git a/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/ContentInfo.java b/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/ContentInfo.java index 7695d20c700..927ff9624de 100644 --- a/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/ContentInfo.java +++ b/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/ContentInfo.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.google.errorprone.annotations.MustBeClosed; -import com.google.protobuf.ByteString; import java.io.OutputStream; import java.io.PrintWriter; import java.io.StringWriter; @@ -34,6 +33,7 @@ import java.util.stream.Stream; import org.projectnessie.model.Content; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.DetachedRef; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.Hash; diff --git a/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/ImportRepository.java b/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/ImportRepository.java index fcd5882b9fc..b9399215a9f 100644 --- a/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/ImportRepository.java +++ b/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/ImportRepository.java @@ -17,7 +17,6 @@ import static org.projectnessie.versioned.storage.common.logic.Logics.repositoryLogic; -import com.google.protobuf.ByteString; import java.io.PrintWriter; import java.nio.file.Files; import java.nio.file.Path; @@ -25,6 +24,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Stream; import javax.annotation.Nonnull; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.ReferenceInfo; diff --git a/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/NessieInfo.java b/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/NessieInfo.java index 0ed5f15c355..cd15571bf41 100644 --- a/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/NessieInfo.java +++ b/servers/quarkus-cli/src/main/java/org/projectnessie/quarkus/cli/NessieInfo.java @@ -19,11 +19,11 @@ import static org.projectnessie.versioned.storage.common.logic.Logics.commitLogic; import static org.projectnessie.versioned.storage.common.logic.Logics.referenceLogic; -import com.google.protobuf.ByteString; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.stream.Collectors; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.GetNamedRefsParams.RetrieveOptions; import org.projectnessie.versioned.ReferenceInfo; diff --git a/servers/quarkus-common/build.gradle.kts b/servers/quarkus-common/build.gradle.kts index c291614e7bc..492c108aab5 100644 --- a/servers/quarkus-common/build.gradle.kts +++ b/servers/quarkus-common/build.gradle.kts @@ -67,8 +67,6 @@ dependencies { compileOnly(libs.jakarta.validation.api) compileOnly(libs.javax.validation.api) - implementation(libs.protobuf.java) - compileOnly(libs.graalvm.nativeimage.svm) compileOnly(platform(libs.jackson.bom)) diff --git a/servers/quarkus-server/build.gradle.kts b/servers/quarkus-server/build.gradle.kts index 83e660ed51a..fba14f38617 100644 --- a/servers/quarkus-server/build.gradle.kts +++ b/servers/quarkus-server/build.gradle.kts @@ -102,7 +102,6 @@ dependencies { testFixturesApi("io.quarkus:quarkus-test-oidc-server") testFixturesApi("io.quarkus:quarkus-jacoco") testFixturesImplementation(libs.guava) - testFixturesImplementation(libs.protobuf.java) testFixturesImplementation(libs.microprofile.openapi) testFixturesApi(platform(libs.junit.bom)) diff --git a/servers/store-proto/build.gradle.kts b/servers/store-proto/build.gradle.kts index ab5ac3e07b1..2ce2bb0eb05 100644 --- a/servers/store-proto/build.gradle.kts +++ b/servers/store-proto/build.gradle.kts @@ -14,7 +14,9 @@ * limitations under the License. */ +import com.google.protobuf.gradle.GenerateProtoTask import com.google.protobuf.gradle.ProtobufExtension +import com.google.protobuf.gradle.ProtobufExtract plugins { `java-library` @@ -22,13 +24,12 @@ plugins { signing id("org.projectnessie.buildsupport.reflectionconfig") `nessie-conventions` + alias(libs.plugins.protobuf) } -apply() - extra["maven.name"] = "Nessie - Server - Store (Proto)" -dependencies { api(libs.protobuf.java) } +dependencies { api(project(path = ":nessie-protobuf-relocated", configuration = "shadow")) } // *.proto files taken from https://github.com/googleapis/googleapis/ repo, available as a git // submodule @@ -40,16 +41,28 @@ extensions.configure { } } +tasks.named("generateProto") { + doLast { + fileTree("$buildDir/generated/source/proto/main").forEach { + it.writeText( + it.readText().replace("com.google.protobuf", "org.projectnessie.nessie.relocated.protobuf") + ) + } + } +} + reflectionConfig { // Consider classes that extend one of these classes... classExtendsPatterns.set( listOf( - "com.google.protobuf.GeneratedMessageV3", - "com.google.protobuf.GeneratedMessageV3.Builder" + "org.projectnessie.nessie.relocated.protobuf.GeneratedMessageV3", + "org.projectnessie.nessie.relocated.protobuf.GeneratedMessageV3.Builder" ) ) // ... and classes the implement this interface. - classImplementsPatterns.set(listOf("com.google.protobuf.ProtocolMessageEnum")) + classImplementsPatterns.set( + listOf("org.projectnessie.nessie.relocated.protobuf.ProtocolMessageEnum") + ) // Also include generated classes (e.g. google.protobuf.Empty) via the "runtimeClasspath", // which contains the the "com.google.protobuf:protobuf-java" dependency. includeConfigurations.set(listOf("runtimeClasspath")) @@ -60,7 +73,7 @@ tasks.named("sourcesJar") { dependsOn(tasks.named("generateProto"), tasks.named("generateReflectionConfig")) } -tasks.withType(com.google.protobuf.gradle.ProtobufExtract::class).configureEach { +tasks.withType(ProtobufExtract::class).configureEach { when (name) { "extractIncludeTestProto" -> dependsOn(tasks.named("processJandexIndex")) "extractIncludeTestFixturesProto" -> dependsOn(tasks.named("processJandexIndex")) diff --git a/servers/store-proto/src/main/proto/table.proto b/servers/store-proto/src/main/proto/org/projectnessie/server/store/proto/table.proto similarity index 100% rename from servers/store-proto/src/main/proto/table.proto rename to servers/store-proto/src/main/proto/org/projectnessie/server/store/proto/table.proto diff --git a/servers/store/src/main/java/org/projectnessie/server/store/BaseSerializer.java b/servers/store/src/main/java/org/projectnessie/server/store/BaseSerializer.java index 4fa2e4b85ce..dfc6618403f 100644 --- a/servers/store/src/main/java/org/projectnessie/server/store/BaseSerializer.java +++ b/servers/store/src/main/java/org/projectnessie/server/store/BaseSerializer.java @@ -15,8 +15,6 @@ */ package org.projectnessie.server.store; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; @@ -29,6 +27,8 @@ import org.projectnessie.model.ImmutableIcebergView; import org.projectnessie.model.ImmutableNamespace; import org.projectnessie.model.Namespace; +import org.projectnessie.nessie.relocated.protobuf.ByteString; +import org.projectnessie.nessie.relocated.protobuf.InvalidProtocolBufferException; import org.projectnessie.server.store.proto.ObjectTypes; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachmentKey; diff --git a/servers/store/src/main/java/org/projectnessie/server/store/DeltaLakeTableSerializer.java b/servers/store/src/main/java/org/projectnessie/server/store/DeltaLakeTableSerializer.java index 5f88dccd688..2cd2c0c944b 100644 --- a/servers/store/src/main/java/org/projectnessie/server/store/DeltaLakeTableSerializer.java +++ b/servers/store/src/main/java/org/projectnessie/server/store/DeltaLakeTableSerializer.java @@ -15,11 +15,11 @@ */ package org.projectnessie.server.store; -import com.google.protobuf.ByteString; import java.util.function.Supplier; import org.projectnessie.model.Content; import org.projectnessie.model.DeltaLakeTable; import org.projectnessie.model.ImmutableDeltaLakeTable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.server.store.proto.ObjectTypes; public final class DeltaLakeTableSerializer extends BaseSerializer { diff --git a/servers/store/src/main/java/org/projectnessie/server/store/IcebergTableSerializer.java b/servers/store/src/main/java/org/projectnessie/server/store/IcebergTableSerializer.java index 40a8ed514d9..8c3ab2474b3 100644 --- a/servers/store/src/main/java/org/projectnessie/server/store/IcebergTableSerializer.java +++ b/servers/store/src/main/java/org/projectnessie/server/store/IcebergTableSerializer.java @@ -15,10 +15,10 @@ */ package org.projectnessie.server.store; -import com.google.protobuf.ByteString; import java.util.function.Supplier; import org.projectnessie.model.Content; import org.projectnessie.model.IcebergTable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.server.store.proto.ObjectTypes; public final class IcebergTableSerializer extends BaseSerializer { diff --git a/servers/store/src/main/java/org/projectnessie/server/store/IcebergViewSerializer.java b/servers/store/src/main/java/org/projectnessie/server/store/IcebergViewSerializer.java index 18ae056ca64..c0fb0441b37 100644 --- a/servers/store/src/main/java/org/projectnessie/server/store/IcebergViewSerializer.java +++ b/servers/store/src/main/java/org/projectnessie/server/store/IcebergViewSerializer.java @@ -15,10 +15,10 @@ */ package org.projectnessie.server.store; -import com.google.protobuf.ByteString; import java.util.function.Supplier; import org.projectnessie.model.Content; import org.projectnessie.model.IcebergView; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.server.store.proto.ObjectTypes; public final class IcebergViewSerializer extends BaseSerializer { diff --git a/servers/store/src/main/java/org/projectnessie/server/store/NamespaceSerializer.java b/servers/store/src/main/java/org/projectnessie/server/store/NamespaceSerializer.java index c70a7789db5..409ddbf7b78 100644 --- a/servers/store/src/main/java/org/projectnessie/server/store/NamespaceSerializer.java +++ b/servers/store/src/main/java/org/projectnessie/server/store/NamespaceSerializer.java @@ -15,10 +15,10 @@ */ package org.projectnessie.server.store; -import com.google.protobuf.ByteString; import java.util.function.Supplier; import org.projectnessie.model.Content; import org.projectnessie.model.Namespace; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.server.store.proto.ObjectTypes; public final class NamespaceSerializer extends BaseSerializer { diff --git a/servers/store/src/main/java/org/projectnessie/server/store/UnknownSerializer.java b/servers/store/src/main/java/org/projectnessie/server/store/UnknownSerializer.java index ea6be3a5fc6..83a3b8745b8 100644 --- a/servers/store/src/main/java/org/projectnessie/server/store/UnknownSerializer.java +++ b/servers/store/src/main/java/org/projectnessie/server/store/UnknownSerializer.java @@ -15,9 +15,9 @@ */ package org.projectnessie.server.store; -import com.google.protobuf.ByteString; import java.util.function.Supplier; import org.projectnessie.model.Content; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.server.store.proto.ObjectTypes; /** diff --git a/servers/store/src/test/java/org/projectnessie/server/store/TestStoreWorker.java b/servers/store/src/test/java/org/projectnessie/server/store/TestStoreWorker.java index d25b29d4290..c459b6e9df8 100644 --- a/servers/store/src/test/java/org/projectnessie/server/store/TestStoreWorker.java +++ b/servers/store/src/test/java/org/projectnessie/server/store/TestStoreWorker.java @@ -21,7 +21,6 @@ import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; import com.google.common.collect.ImmutableMap; -import com.google.protobuf.ByteString; import java.util.AbstractMap; import java.util.Arrays; import java.util.List; @@ -39,6 +38,7 @@ import org.projectnessie.model.IcebergView; import org.projectnessie.model.ImmutableDeltaLakeTable; import org.projectnessie.model.Namespace; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.server.store.proto.ObjectTypes; import org.projectnessie.server.store.proto.ObjectTypes.IcebergMetadataPointer; import org.projectnessie.server.store.proto.ObjectTypes.IcebergRefState; diff --git a/tools/protobuf-relocated/build.gradle.kts b/tools/protobuf-relocated/build.gradle.kts new file mode 100644 index 00000000000..bf8edf5998d --- /dev/null +++ b/tools/protobuf-relocated/build.gradle.kts @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2022 Dremio + * + * 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. + */ + +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + +plugins { + `java-library` + `maven-publish` + signing + id("org.projectnessie.buildsupport.reflectionconfig") + `nessie-conventions` +} + +apply() + +extra["maven.name"] = "Nessie - Relocated Protobuf ${libs.protobuf.java.get().version}" + +dependencies { implementation(libs.protobuf.java) } + +reflectionConfig { + // Consider classes that extend one of these classes... + classExtendsPatterns.set( + listOf( + "com.google.protobuf.GeneratedMessageV3", + "com.google.protobuf.GeneratedMessageV3.Builder" + ) + ) + // ... and classes the implement this interface. + classImplementsPatterns.set(listOf("com.google.protobuf.ProtocolMessageEnum")) + // Also include generated classes (e.g. google.protobuf.Empty) via the "runtimeClasspath", + // which contains the the "com.google.protobuf:protobuf-java" dependency. + includeConfigurations.set(listOf("runtimeClasspath")) + relocations.put("com[.]google[.]protobuf[.]", "org.projectnessie.nessie.relocated.protobuf.$1") +} + +tasks.named("shadowJar") { + dependsOn("generateReflectionConfig") + relocate("com.google.protobuf", "org.projectnessie.nessie.relocated.protobuf") + manifest { + attributes["Google-Protobuf-Version"] = libs.protobuf.java.get().version + } +} diff --git a/versioned/persist/adapter/build.gradle.kts b/versioned/persist/adapter/build.gradle.kts index 6161dc8fbc5..335e60a2fc1 100644 --- a/versioned/persist/adapter/build.gradle.kts +++ b/versioned/persist/adapter/build.gradle.kts @@ -38,7 +38,6 @@ dependencies { compileOnly(libs.jakarta.annotation.api) compileOnly(libs.findbugs.jsr305) - implementation(libs.protobuf.java) implementation(libs.guava) implementation(libs.slf4j.api) implementation(libs.agrona) diff --git a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/CommitLogEntry.java b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/CommitLogEntry.java index bb5a162825b..3edc8fbe243 100644 --- a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/CommitLogEntry.java +++ b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/CommitLogEntry.java @@ -15,11 +15,11 @@ */ package org.projectnessie.versioned.persist.adapter; -import com.google.protobuf.ByteString; import java.util.List; import javax.annotation.Nullable; import org.immutables.value.Value; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.Hash; /** Represents a commit-log-entry stored in the database. */ diff --git a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/CommitParams.java b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/CommitParams.java index b03df622108..932e4dd6869 100644 --- a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/CommitParams.java +++ b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/CommitParams.java @@ -15,7 +15,6 @@ */ package org.projectnessie.versioned.persist.adapter; -import com.google.protobuf.ByteString; import java.util.List; import java.util.Map; import java.util.Optional; @@ -24,6 +23,7 @@ import javax.annotation.Nullable; import org.immutables.value.Value; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.ContentAttachment; /** API helper method to encapsulate parameters for {@link DatabaseAdapter#commit(CommitParams)}. */ diff --git a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/ContentAndState.java b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/ContentAndState.java index 80d391b80c2..59ace87c115 100644 --- a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/ContentAndState.java +++ b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/ContentAndState.java @@ -15,10 +15,10 @@ */ package org.projectnessie.versioned.persist.adapter; -import com.google.protobuf.ByteString; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.immutables.value.Value; +import org.projectnessie.nessie.relocated.protobuf.ByteString; /** Composite for the per-named-reference and global state for a content key. */ @Value.Immutable diff --git a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/ContentIdAndBytes.java b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/ContentIdAndBytes.java index 24cc26f5936..99c8e37090f 100644 --- a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/ContentIdAndBytes.java +++ b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/ContentIdAndBytes.java @@ -15,8 +15,8 @@ */ package org.projectnessie.versioned.persist.adapter; -import com.google.protobuf.ByteString; import org.immutables.value.Value; +import org.projectnessie.nessie.relocated.protobuf.ByteString; /** * Used when dealing with global states in operations for Nessie-GC, like enumerating all globally diff --git a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/DatabaseAdapter.java b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/DatabaseAdapter.java index 1e2f5b0f87c..6da3a3c2735 100644 --- a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/DatabaseAdapter.java +++ b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/DatabaseAdapter.java @@ -17,7 +17,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.errorprone.annotations.MustBeClosed; -import com.google.protobuf.ByteString; import java.util.Collection; import java.util.List; import java.util.Map; @@ -26,6 +25,7 @@ import java.util.stream.Stream; import javax.annotation.Nonnull; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachmentKey; import org.projectnessie.versioned.Diff; diff --git a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/Difference.java b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/Difference.java index 21814c9a187..056aa7f4764 100644 --- a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/Difference.java +++ b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/Difference.java @@ -15,10 +15,10 @@ */ package org.projectnessie.versioned.persist.adapter; -import com.google.protobuf.ByteString; import java.util.Optional; import org.immutables.value.Value; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; @Value.Immutable public interface Difference { diff --git a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/KeyWithBytes.java b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/KeyWithBytes.java index a7f63d99859..08f15553fbf 100644 --- a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/KeyWithBytes.java +++ b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/KeyWithBytes.java @@ -15,9 +15,9 @@ */ package org.projectnessie.versioned.persist.adapter; -import com.google.protobuf.ByteString; import org.immutables.value.Value; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; /** Composite of key, content-id, content-type and content. */ @Value.Immutable diff --git a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/MetadataRewriteParams.java b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/MetadataRewriteParams.java index 902aa71e65d..9e2c944cb87 100644 --- a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/MetadataRewriteParams.java +++ b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/MetadataRewriteParams.java @@ -15,10 +15,10 @@ */ package org.projectnessie.versioned.persist.adapter; -import com.google.protobuf.ByteString; import java.util.Map; import org.immutables.value.Value; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.MergeType; import org.projectnessie.versioned.MetadataRewriter; diff --git a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/ReferencesUtil.java b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/ReferencesUtil.java index 190586a4d92..4f261519be8 100644 --- a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/ReferencesUtil.java +++ b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/ReferencesUtil.java @@ -18,7 +18,6 @@ import static org.projectnessie.versioned.persist.adapter.spi.AbstractDatabaseAdapter.NO_ANCESTOR; import com.google.common.annotations.Beta; -import com.google.protobuf.ByteString; import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -28,6 +27,7 @@ import org.agrona.collections.Object2IntHashMap; import org.agrona.collections.Object2ObjectHashMap; import org.agrona.collections.ObjectHashSet; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.NamedRef; diff --git a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/spi/AbstractDatabaseAdapter.java b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/spi/AbstractDatabaseAdapter.java index 18cfc8c1650..7318109ecc8 100644 --- a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/spi/AbstractDatabaseAdapter.java +++ b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/spi/AbstractDatabaseAdapter.java @@ -37,8 +37,6 @@ import com.google.common.collect.Sets; import com.google.common.hash.Hasher; import com.google.errorprone.annotations.MustBeClosed; -import com.google.protobuf.ByteString; -import com.google.protobuf.UnsafeByteOperations; import io.opentracing.Span; import io.opentracing.Tracer; import io.opentracing.log.Fields; @@ -78,6 +76,8 @@ import javax.annotation.Nonnull; import org.projectnessie.model.Content; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; +import org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.Diff; diff --git a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/spi/DatabaseAdapterUtil.java b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/spi/DatabaseAdapterUtil.java index 969e05371a3..4cf287eabb8 100644 --- a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/spi/DatabaseAdapterUtil.java +++ b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/spi/DatabaseAdapterUtil.java @@ -17,7 +17,6 @@ import com.google.common.hash.Hasher; import com.google.common.hash.Hashing; -import com.google.protobuf.UnsafeByteOperations; import java.nio.charset.StandardCharsets; import java.util.Optional; import java.util.Spliterator; @@ -28,6 +27,7 @@ import java.util.stream.Stream; import java.util.stream.StreamSupport; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.NamedRef; diff --git a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/spi/TracingDatabaseAdapter.java b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/spi/TracingDatabaseAdapter.java index 3541dacb14c..e13c48a696c 100644 --- a/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/spi/TracingDatabaseAdapter.java +++ b/versioned/persist/adapter/src/main/java/org/projectnessie/versioned/persist/adapter/spi/TracingDatabaseAdapter.java @@ -17,7 +17,6 @@ import static org.projectnessie.versioned.persist.adapter.spi.Traced.trace; -import com.google.protobuf.ByteString; import java.util.Collection; import java.util.List; import java.util.Map; @@ -26,6 +25,7 @@ import java.util.stream.Stream; import javax.annotation.Nonnull; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachmentKey; import org.projectnessie.versioned.GetNamedRefsParams; diff --git a/versioned/persist/adapter/src/test/java/org/projectnessie/versioned/persist/adapter/spi/TestFetchValuesUsingOpenAddressing.java b/versioned/persist/adapter/src/test/java/org/projectnessie/versioned/persist/adapter/spi/TestFetchValuesUsingOpenAddressing.java index 59fe6b5224f..efbe0baa4f1 100644 --- a/versioned/persist/adapter/src/test/java/org/projectnessie/versioned/persist/adapter/spi/TestFetchValuesUsingOpenAddressing.java +++ b/versioned/persist/adapter/src/test/java/org/projectnessie/versioned/persist/adapter/spi/TestFetchValuesUsingOpenAddressing.java @@ -23,7 +23,6 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -39,6 +38,7 @@ import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.ValueSource; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.persist.adapter.CommitLogEntry; import org.projectnessie.versioned.persist.adapter.DatabaseAdapterConfig; diff --git a/versioned/persist/adapter/src/test/java/org/projectnessie/versioned/persist/adapter/spi/TestKeyListBuildState.java b/versioned/persist/adapter/src/test/java/org/projectnessie/versioned/persist/adapter/spi/TestKeyListBuildState.java index 45fc786b634..3bf652fa2ea 100644 --- a/versioned/persist/adapter/src/test/java/org/projectnessie/versioned/persist/adapter/spi/TestKeyListBuildState.java +++ b/versioned/persist/adapter/src/test/java/org/projectnessie/versioned/persist/adapter/spi/TestKeyListBuildState.java @@ -25,7 +25,6 @@ import static org.projectnessie.versioned.persist.adapter.spi.DatabaseAdapterUtil.randomHash; import static org.projectnessie.versioned.persist.adapter.spi.KeyListBuildState.MINIMUM_BUCKET_SIZE; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -42,6 +41,7 @@ import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.persist.adapter.CommitLogEntry; import org.projectnessie.versioned.persist.adapter.ContentId; diff --git a/versioned/persist/dynamodb/src/intTest/java/org/projectnessie/versioned/persist/dynamodb/ITDatabaseAdapterDynamo.java b/versioned/persist/dynamodb/src/intTest/java/org/projectnessie/versioned/persist/dynamodb/ITDatabaseAdapterDynamo.java index 24f011ab296..d31c5e94149 100644 --- a/versioned/persist/dynamodb/src/intTest/java/org/projectnessie/versioned/persist/dynamodb/ITDatabaseAdapterDynamo.java +++ b/versioned/persist/dynamodb/src/intTest/java/org/projectnessie/versioned/persist/dynamodb/ITDatabaseAdapterDynamo.java @@ -19,7 +19,6 @@ import static org.projectnessie.versioned.persist.adapter.spi.DatabaseAdapterUtil.randomHash; import static org.projectnessie.versioned.persist.nontx.NonTransactionalOperationContext.NON_TRANSACTIONAL_OPERATION_CONTEXT; -import com.google.protobuf.ByteString; import java.util.Collections; import java.util.HashSet; import java.util.Objects; @@ -29,6 +28,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.persist.adapter.CommitLogEntry; import org.projectnessie.versioned.persist.adapter.KeyList; diff --git a/versioned/persist/dynamodb/src/main/java/org/projectnessie/versioned/persist/dynamodb/DynamoDatabaseAdapter.java b/versioned/persist/dynamodb/src/main/java/org/projectnessie/versioned/persist/dynamodb/DynamoDatabaseAdapter.java index 5d341ad5c08..a8055ce1fd2 100644 --- a/versioned/persist/dynamodb/src/main/java/org/projectnessie/versioned/persist/dynamodb/DynamoDatabaseAdapter.java +++ b/versioned/persist/dynamodb/src/main/java/org/projectnessie/versioned/persist/dynamodb/DynamoDatabaseAdapter.java @@ -39,7 +39,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; -import com.google.protobuf.InvalidProtocolBufferException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -53,6 +52,7 @@ import java.util.stream.IntStream; import java.util.stream.Stream; import javax.annotation.Nonnull; +import org.projectnessie.nessie.relocated.protobuf.InvalidProtocolBufferException; import org.projectnessie.versioned.BackendLimitExceededException; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.NamedRef; diff --git a/versioned/persist/inmem/src/main/java/org/projectnessie/versioned/persist/inmem/InmemoryDatabaseAdapter.java b/versioned/persist/inmem/src/main/java/org/projectnessie/versioned/persist/inmem/InmemoryDatabaseAdapter.java index 4faf3bff179..f0065cda043 100644 --- a/versioned/persist/inmem/src/main/java/org/projectnessie/versioned/persist/inmem/InmemoryDatabaseAdapter.java +++ b/versioned/persist/inmem/src/main/java/org/projectnessie/versioned/persist/inmem/InmemoryDatabaseAdapter.java @@ -22,8 +22,6 @@ import static org.projectnessie.versioned.persist.adapter.spi.DatabaseAdapterUtil.referenceNotFound; import com.google.common.collect.Maps; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; import java.util.List; import java.util.Map.Entry; import java.util.Objects; @@ -33,6 +31,8 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; +import org.projectnessie.nessie.relocated.protobuf.ByteString; +import org.projectnessie.nessie.relocated.protobuf.InvalidProtocolBufferException; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.NamedRef; import org.projectnessie.versioned.ReferenceConflictException; diff --git a/versioned/persist/inmem/src/main/java/org/projectnessie/versioned/persist/inmem/InmemoryStore.java b/versioned/persist/inmem/src/main/java/org/projectnessie/versioned/persist/inmem/InmemoryStore.java index c547714de0e..209abc83ab6 100644 --- a/versioned/persist/inmem/src/main/java/org/projectnessie/versioned/persist/inmem/InmemoryStore.java +++ b/versioned/persist/inmem/src/main/java/org/projectnessie/versioned/persist/inmem/InmemoryStore.java @@ -15,11 +15,11 @@ */ package org.projectnessie.versioned.persist.inmem; -import com.google.protobuf.ByteString; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Stream; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.persist.adapter.DatabaseConnectionProvider; import org.projectnessie.versioned.persist.adapter.RepoDescription; import org.projectnessie.versioned.persist.serialize.AdapterTypes.GlobalStatePointer; diff --git a/versioned/persist/mongodb/src/main/java/org/projectnessie/versioned/persist/mongodb/MongoDatabaseAdapter.java b/versioned/persist/mongodb/src/main/java/org/projectnessie/versioned/persist/mongodb/MongoDatabaseAdapter.java index a160bb68283..423921cf906 100644 --- a/versioned/persist/mongodb/src/main/java/org/projectnessie/versioned/persist/mongodb/MongoDatabaseAdapter.java +++ b/versioned/persist/mongodb/src/main/java/org/projectnessie/versioned/persist/mongodb/MongoDatabaseAdapter.java @@ -20,7 +20,6 @@ import static org.projectnessie.versioned.persist.adapter.serialize.ProtoSerialization.toProto; import com.google.common.collect.Maps; -import com.google.protobuf.InvalidProtocolBufferException; import com.mongodb.DuplicateKeyException; import com.mongodb.ErrorCategory; import com.mongodb.MongoBulkWriteException; @@ -58,6 +57,7 @@ import org.bson.Document; import org.bson.conversions.Bson; import org.bson.types.Binary; +import org.projectnessie.nessie.relocated.protobuf.InvalidProtocolBufferException; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.NamedRef; import org.projectnessie.versioned.ReferenceConflictException; diff --git a/versioned/persist/nontx/src/main/java/org/projectnessie/versioned/persist/nontx/NonTransactionalDatabaseAdapter.java b/versioned/persist/nontx/src/main/java/org/projectnessie/versioned/persist/nontx/NonTransactionalDatabaseAdapter.java index 07f8984d009..8b7ce090fb2 100644 --- a/versioned/persist/nontx/src/main/java/org/projectnessie/versioned/persist/nontx/NonTransactionalDatabaseAdapter.java +++ b/versioned/persist/nontx/src/main/java/org/projectnessie/versioned/persist/nontx/NonTransactionalDatabaseAdapter.java @@ -37,7 +37,6 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import com.google.errorprone.annotations.MustBeClosed; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -64,6 +63,7 @@ import java.util.stream.Stream; import java.util.stream.StreamSupport; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachmentKey; diff --git a/versioned/persist/rocks/src/main/java/org/projectnessie/versioned/persist/rocks/RocksDatabaseAdapter.java b/versioned/persist/rocks/src/main/java/org/projectnessie/versioned/persist/rocks/RocksDatabaseAdapter.java index bd0bd91760f..087d0ffcd79 100644 --- a/versioned/persist/rocks/src/main/java/org/projectnessie/versioned/persist/rocks/RocksDatabaseAdapter.java +++ b/versioned/persist/rocks/src/main/java/org/projectnessie/versioned/persist/rocks/RocksDatabaseAdapter.java @@ -23,8 +23,6 @@ import static org.projectnessie.versioned.persist.adapter.spi.DatabaseAdapterUtil.hashCollisionDetected; import com.google.common.collect.Maps; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -42,6 +40,8 @@ import java.util.stream.IntStream; import java.util.stream.Stream; import java.util.stream.StreamSupport; +import org.projectnessie.nessie.relocated.protobuf.ByteString; +import org.projectnessie.nessie.relocated.protobuf.InvalidProtocolBufferException; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.NamedRef; import org.projectnessie.versioned.ReferenceConflictException; diff --git a/versioned/persist/serialize-proto/build.gradle.kts b/versioned/persist/serialize-proto/build.gradle.kts index bf0a3d836a1..fbf4c0ebd28 100644 --- a/versioned/persist/serialize-proto/build.gradle.kts +++ b/versioned/persist/serialize-proto/build.gradle.kts @@ -14,7 +14,9 @@ * limitations under the License. */ +import com.google.protobuf.gradle.GenerateProtoTask import com.google.protobuf.gradle.ProtobufExtension +import com.google.protobuf.gradle.ProtobufExtract plugins { `java-library` @@ -22,13 +24,12 @@ plugins { signing id("org.projectnessie.buildsupport.reflectionconfig") `nessie-conventions` + alias(libs.plugins.protobuf) } -apply() - extra["maven.name"] = "Nessie - Versioned - Persist - Serialization (Proto)" -dependencies { api(libs.protobuf.java) } +dependencies { api(project(path = ":nessie-protobuf-relocated", configuration = "shadow")) } // *.proto files taken from https://github.com/googleapis/googleapis/ repo, available as a git // submodule @@ -40,16 +41,28 @@ extensions.configure { } } +tasks.named("generateProto") { + doLast { + fileTree("$buildDir/generated/source/proto/main").forEach { + it.writeText( + it.readText().replace("com.google.protobuf", "org.projectnessie.nessie.relocated.protobuf") + ) + } + } +} + reflectionConfig { // Consider classes that extend one of these classes... classExtendsPatterns.set( listOf( - "com.google.protobuf.GeneratedMessageV3", - "com.google.protobuf.GeneratedMessageV3.Builder" + "org.projectnessie.nessie.relocated.protobuf.GeneratedMessageV3", + "org.projectnessie.nessie.relocated.protobuf.GeneratedMessageV3.Builder" ) ) // ... and classes the implement this interface. - classImplementsPatterns.set(listOf("com.google.protobuf.ProtocolMessageEnum")) + classImplementsPatterns.set( + listOf("org.projectnessie.nessie.relocated.protobuf.ProtocolMessageEnum") + ) // Also include generated classes (e.g. google.protobuf.Empty) via the "runtimeClasspath", // which contains the the "com.google.protobuf:protobuf-java" dependency. includeConfigurations.set(listOf("runtimeClasspath")) @@ -60,7 +73,7 @@ tasks.named("sourcesJar") { dependsOn(tasks.named("generateProto"), tasks.named("generateReflectionConfig")) } -tasks.withType(com.google.protobuf.gradle.ProtobufExtract::class).configureEach { +tasks.withType(ProtobufExtract::class).configureEach { when (name) { "extractIncludeTestProto" -> dependsOn(tasks.named("processJandexIndex")) "extractIncludeTestFixturesProto" -> dependsOn(tasks.named("processJandexIndex")) diff --git a/versioned/persist/serialize-proto/src/main/proto/persist.proto b/versioned/persist/serialize-proto/src/main/proto/org/projectnessie/versioned/persist/serialize/persist.proto similarity index 100% rename from versioned/persist/serialize-proto/src/main/proto/persist.proto rename to versioned/persist/serialize-proto/src/main/proto/org/projectnessie/versioned/persist/serialize/persist.proto diff --git a/versioned/persist/serialize/src/main/java/org/projectnessie/versioned/persist/adapter/serialize/ProtoSerialization.java b/versioned/persist/serialize/src/main/java/org/projectnessie/versioned/persist/adapter/serialize/ProtoSerialization.java index 6aa3af54570..fd595091ba9 100644 --- a/versioned/persist/serialize/src/main/java/org/projectnessie/versioned/persist/adapter/serialize/ProtoSerialization.java +++ b/versioned/persist/serialize/src/main/java/org/projectnessie/versioned/persist/adapter/serialize/ProtoSerialization.java @@ -16,10 +16,10 @@ package org.projectnessie.versioned.persist.adapter.serialize; import com.google.common.base.Preconditions; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; import java.util.TreeMap; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; +import org.projectnessie.nessie.relocated.protobuf.InvalidProtocolBufferException; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachment.Compression; import org.projectnessie.versioned.ContentAttachment.Format; diff --git a/versioned/persist/serialize/src/test/java/org/projectnessie/versioned/persist/adapter/serialize/TestSerialization.java b/versioned/persist/serialize/src/test/java/org/projectnessie/versioned/persist/adapter/serialize/TestSerialization.java index 3a9426cb0b5..7eb219e59fe 100644 --- a/versioned/persist/serialize/src/test/java/org/projectnessie/versioned/persist/adapter/serialize/TestSerialization.java +++ b/versioned/persist/serialize/src/test/java/org/projectnessie/versioned/persist/adapter/serialize/TestSerialization.java @@ -21,10 +21,6 @@ import static org.projectnessie.versioned.persist.adapter.serialize.ProtoSerialization.toProtoKey; import static org.projectnessie.versioned.persist.adapter.serialize.ProtoSerialization.toProtoValue; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; -import com.google.protobuf.MessageLite; -import com.google.protobuf.UnsafeByteOperations; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -43,6 +39,10 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; +import org.projectnessie.nessie.relocated.protobuf.InvalidProtocolBufferException; +import org.projectnessie.nessie.relocated.protobuf.MessageLite; +import org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachment.Compression; import org.projectnessie.versioned.ContentAttachment.Format; diff --git a/versioned/persist/store/build.gradle.kts b/versioned/persist/store/build.gradle.kts index fdd3338e6f9..a2ec9b56cce 100644 --- a/versioned/persist/store/build.gradle.kts +++ b/versioned/persist/store/build.gradle.kts @@ -28,7 +28,6 @@ dependencies { implementation(project(":nessie-model")) implementation(project(":nessie-versioned-persist-adapter")) implementation(project(":nessie-versioned-spi")) - implementation(libs.protobuf.java) implementation(libs.guava) // javax/jakarta diff --git a/versioned/persist/store/src/main/java/org/projectnessie/versioned/persist/store/PersistVersionStore.java b/versioned/persist/store/src/main/java/org/projectnessie/versioned/persist/store/PersistVersionStore.java index d2b366fa167..05d33aafa73 100644 --- a/versioned/persist/store/src/main/java/org/projectnessie/versioned/persist/store/PersistVersionStore.java +++ b/versioned/persist/store/src/main/java/org/projectnessie/versioned/persist/store/PersistVersionStore.java @@ -21,7 +21,6 @@ import com.google.common.base.Preconditions; import com.google.errorprone.annotations.MustBeClosed; -import com.google.protobuf.ByteString; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -39,6 +38,7 @@ import org.projectnessie.model.Content; import org.projectnessie.model.ContentKey; import org.projectnessie.model.ImmutableCommitMeta; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.Commit; import org.projectnessie.versioned.CommitMetaSerializer; diff --git a/versioned/persist/tests/build.gradle.kts b/versioned/persist/tests/build.gradle.kts index ccc6e0e83b2..1d93a4c8f9d 100644 --- a/versioned/persist/tests/build.gradle.kts +++ b/versioned/persist/tests/build.gradle.kts @@ -34,7 +34,6 @@ dependencies { implementation(libs.guava) implementation(libs.micrometer.core) implementation(libs.opentracing.mock) - implementation(libs.protobuf.java) compileOnly(platform(libs.jackson.bom)) compileOnly(libs.jackson.annotations) diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractCommitLogScan.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractCommitLogScan.java index 8b4553943d3..09b7d228df1 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractCommitLogScan.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractCommitLogScan.java @@ -20,7 +20,6 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; -import com.google.protobuf.ByteString; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -34,6 +33,7 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.Hash; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractCommitScenarios.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractCommitScenarios.java index 88bff7e8c98..15abd8caf7a 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractCommitScenarios.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractCommitScenarios.java @@ -22,7 +22,6 @@ import static org.projectnessie.versioned.testworker.OnRefOnly.newOnRef; import static org.projectnessie.versioned.testworker.OnRefOnly.onRef; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -40,6 +39,7 @@ import org.junit.jupiter.params.provider.ValueSource; import org.projectnessie.model.Content; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.Hash; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractConcurrency.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractConcurrency.java index 935ad1244b6..ce5b9c1771b 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractConcurrency.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractConcurrency.java @@ -20,7 +20,6 @@ import static org.projectnessie.versioned.persist.tests.DatabaseAdapterTestUtils.ALWAYS_THROWING_ATTACHMENT_CONSUMER; import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; -import com.google.protobuf.ByteString; import io.micrometer.core.instrument.simple.SimpleMeterRegistry; import java.util.ArrayList; import java.util.HashMap; @@ -44,6 +43,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.ReferenceConflictException; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractContentAttachments.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractContentAttachments.java index 6853bf68478..2d174003ade 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractContentAttachments.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractContentAttachments.java @@ -17,7 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.google.protobuf.ByteString; import java.util.List; import java.util.Optional; import java.util.concurrent.ThreadLocalRandom; @@ -28,6 +27,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachment.Compression; import org.projectnessie.versioned.ContentAttachment.Format; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractDiff.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractDiff.java index ad60fcbb4aa..3ebd95fe318 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractDiff.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractDiff.java @@ -19,13 +19,13 @@ import static org.projectnessie.versioned.persist.tests.DatabaseAdapterTestUtils.ALWAYS_THROWING_ATTACHMENT_CONSUMER; import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; -import com.google.protobuf.ByteString; import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.persist.adapter.ContentId; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractEvents.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractEvents.java index 01490c72a8d..81f017d7b6a 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractEvents.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractEvents.java @@ -21,12 +21,12 @@ import static org.assertj.core.api.InstanceOfAssertFactories.type; import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.List; import java.util.Optional; import org.junit.jupiter.api.Test; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.MergeResult; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractGetNamedReferences.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractGetNamedReferences.java index a7115fdd18f..27220fde199 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractGetNamedReferences.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractGetNamedReferences.java @@ -15,7 +15,6 @@ */ package org.projectnessie.versioned.persist.tests; -import com.google.protobuf.ByteString; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -28,6 +27,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.GetNamedRefsParams.RetrieveOptions; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractManyCommits.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractManyCommits.java index bbab0cdf000..58870b5d488 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractManyCommits.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractManyCommits.java @@ -20,7 +20,6 @@ import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; import com.google.common.collect.Maps; -import com.google.protobuf.ByteString; import java.util.Collections; import java.util.Map; import java.util.Optional; @@ -33,6 +32,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.ReferenceNotFoundException; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractManyKeys.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractManyKeys.java index c1b537a040f..e92cfb6c50e 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractManyKeys.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractManyKeys.java @@ -23,7 +23,6 @@ import static org.projectnessie.versioned.testworker.OnRefOnly.onRef; import com.google.common.base.Preconditions; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -48,6 +47,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.Hash; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractMergeTransplant.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractMergeTransplant.java index a15a3bcdfee..b11b8178069 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractMergeTransplant.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractMergeTransplant.java @@ -21,7 +21,6 @@ import static org.projectnessie.versioned.persist.tests.DatabaseAdapterTestUtils.ALWAYS_THROWING_ATTACHMENT_CONSUMER; import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; -import com.google.protobuf.ByteString; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -36,6 +35,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.ImmutableKeyDetails; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractRefLog.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractRefLog.java index 32362ecb0e4..7abe0a53cba 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractRefLog.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractRefLog.java @@ -21,7 +21,6 @@ import static org.assertj.core.groups.Tuple.tuple; import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -35,6 +34,7 @@ import org.assertj.core.groups.Tuple; import org.junit.jupiter.api.Test; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.Hash; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractReferences.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractReferences.java index ba30144c575..23b1cd2eb28 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractReferences.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractReferences.java @@ -21,7 +21,6 @@ import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; import static org.projectnessie.versioned.testworker.OnRefOnly.onRef; -import com.google.protobuf.ByteString; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -32,6 +31,7 @@ import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.Hash; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractRepositories.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractRepositories.java index 46517eda551..11c0113cedb 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractRepositories.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractRepositories.java @@ -21,12 +21,12 @@ import static org.projectnessie.versioned.store.DefaultStoreWorker.payloadForContent; import static org.projectnessie.versioned.testworker.OnRefOnly.onRef; -import com.google.protobuf.ByteString; import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.Hash; diff --git a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractWriteUpdateCommits.java b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractWriteUpdateCommits.java index e0725a75753..2691e3cff8a 100644 --- a/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractWriteUpdateCommits.java +++ b/versioned/persist/tests/src/main/java/org/projectnessie/versioned/persist/tests/AbstractWriteUpdateCommits.java @@ -21,12 +21,12 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.api.Assumptions.assumeThat; -import com.google.protobuf.ByteString; import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; import org.junit.jupiter.api.Test; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.ReferenceConflictException; import org.projectnessie.versioned.ReferenceNotFoundException; diff --git a/versioned/persist/tx/src/main/java/org/projectnessie/versioned/persist/tx/TxDatabaseAdapter.java b/versioned/persist/tx/src/main/java/org/projectnessie/versioned/persist/tx/TxDatabaseAdapter.java index 207858b40c6..ae48b35ac8d 100644 --- a/versioned/persist/tx/src/main/java/org/projectnessie/versioned/persist/tx/TxDatabaseAdapter.java +++ b/versioned/persist/tx/src/main/java/org/projectnessie/versioned/persist/tx/TxDatabaseAdapter.java @@ -44,9 +44,6 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.errorprone.annotations.MustBeClosed; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; -import com.google.protobuf.UnsafeByteOperations; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -72,6 +69,9 @@ import java.util.stream.IntStream; import java.util.stream.Stream; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; +import org.projectnessie.nessie.relocated.protobuf.InvalidProtocolBufferException; +import org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachmentKey; diff --git a/versioned/spi/build.gradle.kts b/versioned/spi/build.gradle.kts index 6442dca995d..c3ae968f18f 100644 --- a/versioned/spi/build.gradle.kts +++ b/versioned/spi/build.gradle.kts @@ -26,7 +26,7 @@ extra["maven.name"] = "Nessie - Versioned Store SPI" dependencies { implementation(project(":nessie-model")) - implementation(libs.protobuf.java) + api(project(path = ":nessie-protobuf-relocated", configuration = "shadow")) implementation(libs.jackson.databind) compileOnly(libs.immutables.builder) compileOnly(libs.immutables.value.annotations) diff --git a/versioned/spi/src/main/java/org/projectnessie/versioned/CommitMetaSerializer.java b/versioned/spi/src/main/java/org/projectnessie/versioned/CommitMetaSerializer.java index 5ba75632661..688dd6d3f76 100644 --- a/versioned/spi/src/main/java/org/projectnessie/versioned/CommitMetaSerializer.java +++ b/versioned/spi/src/main/java/org/projectnessie/versioned/CommitMetaSerializer.java @@ -16,13 +16,13 @@ package org.projectnessie.versioned; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.protobuf.ByteString; -import com.google.protobuf.ByteString.Output; import java.io.IOException; import java.io.InputStream; import org.projectnessie.model.CommitMeta; import org.projectnessie.model.ImmutableCommitMeta; import org.projectnessie.model.ser.Views; +import org.projectnessie.nessie.relocated.protobuf.ByteString; +import org.projectnessie.nessie.relocated.protobuf.ByteString.Output; public class CommitMetaSerializer implements Serializer { diff --git a/versioned/spi/src/main/java/org/projectnessie/versioned/ContentAttachment.java b/versioned/spi/src/main/java/org/projectnessie/versioned/ContentAttachment.java index 6a753f4fe35..bda37528ab1 100644 --- a/versioned/spi/src/main/java/org/projectnessie/versioned/ContentAttachment.java +++ b/versioned/spi/src/main/java/org/projectnessie/versioned/ContentAttachment.java @@ -15,9 +15,9 @@ */ package org.projectnessie.versioned; -import com.google.protobuf.ByteString; import javax.annotation.Nullable; import org.immutables.value.Value; +import org.projectnessie.nessie.relocated.protobuf.ByteString; /** Represents all fields of a "content attachment" in Nessie. */ @Value.Immutable diff --git a/versioned/spi/src/main/java/org/projectnessie/versioned/Hash.java b/versioned/spi/src/main/java/org/projectnessie/versioned/Hash.java index 6358a971e3e..46e1d3242b0 100644 --- a/versioned/spi/src/main/java/org/projectnessie/versioned/Hash.java +++ b/versioned/spi/src/main/java/org/projectnessie/versioned/Hash.java @@ -19,10 +19,10 @@ import static java.util.Objects.requireNonNull; import com.google.common.annotations.VisibleForTesting; -import com.google.protobuf.ByteString; -import com.google.protobuf.UnsafeByteOperations; import java.util.Arrays; import javax.annotation.Nonnull; +import org.projectnessie.nessie.relocated.protobuf.ByteString; +import org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations; /** * Describes a specific point in time/history. Internally is a binary value but a string diff --git a/versioned/spi/src/main/java/org/projectnessie/versioned/Serializer.java b/versioned/spi/src/main/java/org/projectnessie/versioned/Serializer.java index 5ed147a282f..839a15ccd07 100644 --- a/versioned/spi/src/main/java/org/projectnessie/versioned/Serializer.java +++ b/versioned/spi/src/main/java/org/projectnessie/versioned/Serializer.java @@ -15,8 +15,8 @@ */ package org.projectnessie.versioned; -import com.google.protobuf.ByteString; import java.io.Serializable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; /** * Used to serialize & deserialize the values in the store. Provided to an implementation of diff --git a/versioned/spi/src/main/java/org/projectnessie/versioned/StoreWorker.java b/versioned/spi/src/main/java/org/projectnessie/versioned/StoreWorker.java index 2e90def18e8..50204fbf011 100644 --- a/versioned/spi/src/main/java/org/projectnessie/versioned/StoreWorker.java +++ b/versioned/spi/src/main/java/org/projectnessie/versioned/StoreWorker.java @@ -15,12 +15,12 @@ */ package org.projectnessie.versioned; -import com.google.protobuf.ByteString; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Stream; import org.projectnessie.model.Content; +import org.projectnessie.nessie.relocated.protobuf.ByteString; /** A set of helpers that users of a VersionStore must implement. */ public interface StoreWorker { diff --git a/versioned/spi/src/main/java/org/projectnessie/versioned/store/ContentSerializer.java b/versioned/spi/src/main/java/org/projectnessie/versioned/store/ContentSerializer.java index bef0ba77729..75a178bcf9c 100644 --- a/versioned/spi/src/main/java/org/projectnessie/versioned/store/ContentSerializer.java +++ b/versioned/spi/src/main/java/org/projectnessie/versioned/store/ContentSerializer.java @@ -15,12 +15,12 @@ */ package org.projectnessie.versioned.store; -import com.google.protobuf.ByteString; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Stream; import org.projectnessie.model.Content; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachmentKey; diff --git a/versioned/spi/src/main/java/org/projectnessie/versioned/store/DefaultStoreWorker.java b/versioned/spi/src/main/java/org/projectnessie/versioned/store/DefaultStoreWorker.java index a8d35d3a14f..a50e48a6727 100644 --- a/versioned/spi/src/main/java/org/projectnessie/versioned/store/DefaultStoreWorker.java +++ b/versioned/spi/src/main/java/org/projectnessie/versioned/store/DefaultStoreWorker.java @@ -15,7 +15,6 @@ */ package org.projectnessie.versioned.store; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -27,6 +26,7 @@ import java.util.stream.Stream; import javax.annotation.Nonnull; import org.projectnessie.model.Content; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachmentKey; import org.projectnessie.versioned.StoreWorker; diff --git a/versioned/spi/src/test/java/org/projectnessie/versioned/TestCommitMetaSerializer.java b/versioned/spi/src/test/java/org/projectnessie/versioned/TestCommitMetaSerializer.java index 346cdc34812..28afbef6881 100644 --- a/versioned/spi/src/test/java/org/projectnessie/versioned/TestCommitMetaSerializer.java +++ b/versioned/spi/src/test/java/org/projectnessie/versioned/TestCommitMetaSerializer.java @@ -19,12 +19,12 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.protobuf.ByteString; import java.time.Instant; import org.junit.jupiter.api.Test; import org.projectnessie.model.CommitMeta; import org.projectnessie.model.ImmutableCommitMeta; import org.projectnessie.model.ser.Views; +import org.projectnessie.nessie.relocated.protobuf.ByteString; public class TestCommitMetaSerializer { diff --git a/versioned/spi/src/test/java/org/projectnessie/versioned/TestHash.java b/versioned/spi/src/test/java/org/projectnessie/versioned/TestHash.java index b39bf6a82a0..da08f35851a 100644 --- a/versioned/spi/src/test/java/org/projectnessie/versioned/TestHash.java +++ b/versioned/spi/src/test/java/org/projectnessie/versioned/TestHash.java @@ -19,7 +19,6 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.params.provider.Arguments.arguments; -import com.google.protobuf.ByteString; import java.util.Locale; import java.util.stream.Stream; import org.junit.jupiter.api.Test; @@ -27,6 +26,7 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.Hash.GenericHash; import org.projectnessie.versioned.Hash.Hash256; diff --git a/versioned/storage/cassandra/build.gradle.kts b/versioned/storage/cassandra/build.gradle.kts index 16b9f6ba859..80012781029 100644 --- a/versioned/storage/cassandra/build.gradle.kts +++ b/versioned/storage/cassandra/build.gradle.kts @@ -43,7 +43,6 @@ dependencies { implementation(libs.guava) implementation(libs.slf4j.api) - implementation(libs.protobuf.java) implementation(platform(libs.cassandra.driver.bom)) implementation(libs.cassandra.driver.core) diff --git a/versioned/storage/cassandra/src/main/java/org/projectnessie/versioned/storage/cassandra/CassandraPersist.java b/versioned/storage/cassandra/src/main/java/org/projectnessie/versioned/storage/cassandra/CassandraPersist.java index 6086df7bf3c..91fb14e6665 100644 --- a/versioned/storage/cassandra/src/main/java/org/projectnessie/versioned/storage/cassandra/CassandraPersist.java +++ b/versioned/storage/cassandra/src/main/java/org/projectnessie/versioned/storage/cassandra/CassandraPersist.java @@ -17,8 +17,8 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; -import static com.google.protobuf.UnsafeByteOperations.unsafeWrap; import static java.util.Collections.singletonList; +import static org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations.unsafeWrap; import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.ADD_REFERENCE; import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.COLS_COMMIT; import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.COLS_INDEX; @@ -94,7 +94,6 @@ import com.datastax.oss.driver.api.core.cql.AsyncResultSet; import com.datastax.oss.driver.api.core.cql.Row; import com.google.common.collect.AbstractIterator; -import com.google.protobuf.ByteString; import java.io.IOException; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -110,6 +109,7 @@ import java.util.stream.Collectors; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.cassandra.CassandraBackend.BatchedQuery; import org.projectnessie.versioned.storage.common.config.StoreConfig; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; diff --git a/versioned/storage/common-proto/build.gradle.kts b/versioned/storage/common-proto/build.gradle.kts index 149a74a17e1..c40b27b3a14 100644 --- a/versioned/storage/common-proto/build.gradle.kts +++ b/versioned/storage/common-proto/build.gradle.kts @@ -14,7 +14,9 @@ * limitations under the License. */ +import com.google.protobuf.gradle.GenerateProtoTask import com.google.protobuf.gradle.ProtobufExtension +import com.google.protobuf.gradle.ProtobufExtract plugins { `java-library` @@ -22,15 +24,14 @@ plugins { signing id("org.projectnessie.buildsupport.reflectionconfig") `nessie-conventions` + alias(libs.plugins.protobuf) } -apply() - extra["maven.name"] = "Nessie - Storage - Common proto" description = "Protobuf definition for the serialization for storage objects." -dependencies { implementation(libs.protobuf.java) } +dependencies { api(project(path = ":nessie-protobuf-relocated", configuration = "shadow")) } // *.proto files taken from https://github.com/googleapis/googleapis/ repo, available as a git // submodule @@ -42,16 +43,28 @@ extensions.configure { } } +tasks.named("generateProto") { + doLast { + fileTree("$buildDir/generated/source/proto/main").forEach { + it.writeText( + it.readText().replace("com.google.protobuf", "org.projectnessie.nessie.relocated.protobuf") + ) + } + } +} + reflectionConfig { // Consider classes that extend one of these classes... classExtendsPatterns.set( listOf( - "com.google.protobuf.GeneratedMessageV3", - "com.google.protobuf.GeneratedMessageV3.Builder" + "org.projectnessie.nessie.relocated.protobuf.GeneratedMessageV3", + "org.projectnessie.nessie.relocated.protobuf.GeneratedMessageV3.Builder" ) ) // ... and classes the implement this interface. - classImplementsPatterns.set(listOf("com.google.protobuf.ProtocolMessageEnum")) + classImplementsPatterns.set( + listOf("org.projectnessie.nessie.relocated.protobuf.ProtocolMessageEnum") + ) // Also include generated classes (e.g. google.protobuf.Empty) via the "runtimeClasspath", // which contains the the "com.google.protobuf:protobuf-java" dependency. includeConfigurations.set(listOf("runtimeClasspath")) @@ -62,7 +75,7 @@ tasks.named("sourcesJar") { dependsOn(tasks.named("generateProto"), tasks.named("generateReflectionConfig")) } -tasks.withType(com.google.protobuf.gradle.ProtobufExtract::class).configureEach { +tasks.withType(ProtobufExtract::class).configureEach { when (name) { "extractIncludeTestProto" -> dependsOn(tasks.named("processJandexIndex")) "extractIncludeTestFixturesProto" -> dependsOn(tasks.named("processJandexIndex")) diff --git a/versioned/storage/common-proto/src/main/proto/storage.proto b/versioned/storage/common-proto/src/main/proto/org/projectnessie/versioned/storage/common/proto/storage.proto similarity index 100% rename from versioned/storage/common-proto/src/main/proto/storage.proto rename to versioned/storage/common-proto/src/main/proto/org/projectnessie/versioned/storage/common/proto/storage.proto diff --git a/versioned/storage/common-serialize/build.gradle.kts b/versioned/storage/common-serialize/build.gradle.kts index 6df5023be46..bf181093fb4 100644 --- a/versioned/storage/common-serialize/build.gradle.kts +++ b/versioned/storage/common-serialize/build.gradle.kts @@ -27,10 +27,8 @@ extra["maven.name"] = "Nessie - Storage - Common proto serialization" description = "Protobuf based serialization for storage objects." dependencies { - implementation(project(":nessie-versioned-storage-common")) - implementation(project(":nessie-versioned-storage-common-proto")) - - implementation(libs.protobuf.java) + api(project(":nessie-versioned-storage-common")) + api(project(":nessie-versioned-storage-common-proto")) testImplementation(platform(libs.junit.bom)) testImplementation(libs.bundles.junit.testing) diff --git a/versioned/storage/common-serialize/src/main/java/org/projectnessie/versioned/storage/serialize/ProtoSerialization.java b/versioned/storage/common-serialize/src/main/java/org/projectnessie/versioned/storage/serialize/ProtoSerialization.java index 09af05befa3..36eae58e789 100644 --- a/versioned/storage/common-serialize/src/main/java/org/projectnessie/versioned/storage/serialize/ProtoSerialization.java +++ b/versioned/storage/common-serialize/src/main/java/org/projectnessie/versioned/storage/serialize/ProtoSerialization.java @@ -25,11 +25,11 @@ import static org.projectnessie.versioned.storage.common.objtypes.StringObj.stringData; import static org.projectnessie.versioned.storage.common.objtypes.TagObj.tag; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; +import org.projectnessie.nessie.relocated.protobuf.ByteString; +import org.projectnessie.nessie.relocated.protobuf.InvalidProtocolBufferException; import org.projectnessie.versioned.storage.common.exceptions.ObjTooLargeException; import org.projectnessie.versioned.storage.common.objtypes.CommitHeaders; import org.projectnessie.versioned.storage.common.objtypes.CommitObj; diff --git a/versioned/storage/common-tests/build.gradle.kts b/versioned/storage/common-tests/build.gradle.kts index 07996c675e6..8cba956ade8 100644 --- a/versioned/storage/common-tests/build.gradle.kts +++ b/versioned/storage/common-tests/build.gradle.kts @@ -43,7 +43,6 @@ dependencies { compileOnly(libs.errorprone.annotations) implementation(libs.guava) - implementation(libs.protobuf.java) implementation(libs.logback.classic) diff --git a/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/AbstractBasePersistTests.java b/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/AbstractBasePersistTests.java index 13a937493cb..1f13eedfa8a 100644 --- a/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/AbstractBasePersistTests.java +++ b/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/AbstractBasePersistTests.java @@ -16,7 +16,6 @@ package org.projectnessie.versioned.storage.commontests; import static com.google.common.collect.Lists.newArrayList; -import static com.google.protobuf.ByteString.copyFromUtf8; import static java.lang.String.format; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Arrays.asList; @@ -28,6 +27,7 @@ import static org.assertj.core.api.Assumptions.assumeThat; import static org.assertj.core.api.InstanceOfAssertFactories.list; import static org.assertj.core.api.InstanceOfAssertFactories.type; +import static org.projectnessie.nessie.relocated.protobuf.ByteString.copyFromUtf8; import static org.projectnessie.versioned.storage.common.config.StoreConfig.CONFIG_MAX_INCREMENTAL_INDEX_SIZE; import static org.projectnessie.versioned.storage.common.config.StoreConfig.CONFIG_MAX_SERIALIZED_INDEX_SIZE; import static org.projectnessie.versioned.storage.common.config.StoreConfig.CONFIG_REPOSITORY_ID; @@ -63,7 +63,6 @@ import static org.projectnessie.versioned.storage.common.persist.Reference.reference; import com.google.common.collect.Lists; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.EnumSet; import java.util.List; @@ -80,6 +79,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; import org.projectnessie.versioned.storage.common.exceptions.ObjTooLargeException; import org.projectnessie.versioned.storage.common.exceptions.RefAlreadyExistsException; diff --git a/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/AbstractCommitLogicTests.java b/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/AbstractCommitLogicTests.java index 50656821d7d..d1187ad2575 100644 --- a/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/AbstractCommitLogicTests.java +++ b/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/AbstractCommitLogicTests.java @@ -40,7 +40,6 @@ import static org.projectnessie.versioned.storage.common.persist.ObjId.objIdFromString; import static org.projectnessie.versioned.storage.common.persist.ObjId.randomObjId; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; @@ -60,6 +59,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; import org.projectnessie.versioned.storage.common.indexes.StoreKey; import org.projectnessie.versioned.storage.common.logic.CommitLogic; diff --git a/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/AbstractReferenceLogicTests.java b/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/AbstractReferenceLogicTests.java index 9dfe5ddffa6..f67feff9f02 100644 --- a/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/AbstractReferenceLogicTests.java +++ b/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/AbstractReferenceLogicTests.java @@ -16,7 +16,6 @@ package org.projectnessie.versioned.storage.commontests; import static com.google.common.collect.Lists.newArrayList; -import static com.google.protobuf.ByteString.copyFromUtf8; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; import static java.util.stream.IntStream.rangeClosed; @@ -24,6 +23,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.spy; +import static org.projectnessie.nessie.relocated.protobuf.ByteString.copyFromUtf8; import static org.projectnessie.versioned.storage.common.config.StoreConfig.CONFIG_COMMIT_TIMEOUT_MILLIS; import static org.projectnessie.versioned.storage.common.logic.CommitLogQuery.commitLogQuery; import static org.projectnessie.versioned.storage.common.logic.InternalRef.REF_REPO; diff --git a/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/KeyIndexTestSet.java b/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/KeyIndexTestSet.java index 124475d90b9..3c3666743da 100644 --- a/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/KeyIndexTestSet.java +++ b/versioned/storage/common-tests/src/main/java/org/projectnessie/versioned/storage/commontests/KeyIndexTestSet.java @@ -26,7 +26,6 @@ import static org.projectnessie.versioned.storage.common.objtypes.CommitOp.commitOp; import static org.projectnessie.versioned.storage.common.persist.ObjId.randomObjId; -import com.google.protobuf.ByteString; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; @@ -44,6 +43,7 @@ import java.util.stream.IntStream; import java.util.zip.GZIPInputStream; import org.immutables.value.Value; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.indexes.ElementSerializer; import org.projectnessie.versioned.storage.common.indexes.StoreIndex; import org.projectnessie.versioned.storage.common.indexes.StoreIndexElement; diff --git a/versioned/storage/common/build.gradle.kts b/versioned/storage/common/build.gradle.kts index 0e4b4a586fe..e4481a23a85 100644 --- a/versioned/storage/common/build.gradle.kts +++ b/versioned/storage/common/build.gradle.kts @@ -37,7 +37,7 @@ dependencies { compileOnly(libs.errorprone.annotations) implementation(libs.agrona) implementation(libs.guava) - implementation(libs.protobuf.java) + implementation(project(path = ":nessie-protobuf-relocated", configuration = "shadow")) implementation(libs.slf4j.api) compileOnly(libs.immutables.builder) diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/ImmutableEmptyIndexImpl.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/ImmutableEmptyIndexImpl.java index 36f159af0a2..07009b24af3 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/ImmutableEmptyIndexImpl.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/ImmutableEmptyIndexImpl.java @@ -15,12 +15,11 @@ */ package org.projectnessie.versioned.storage.common.indexes; -import static com.google.protobuf.UnsafeByteOperations.unsafeWrap; import static java.util.Collections.emptyIterator; import static java.util.Collections.emptyList; +import static org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations.unsafeWrap; import static org.projectnessie.versioned.storage.common.indexes.StoreIndexes.newStoreIndex; -import com.google.protobuf.ByteString; import java.nio.ByteBuffer; import java.util.Iterator; import java.util.List; @@ -28,6 +27,7 @@ import java.util.function.Function; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; final class ImmutableEmptyIndexImpl implements StoreIndex { diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/LayeredIndexImpl.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/LayeredIndexImpl.java index fda02bd6e87..1ba6885d991 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/LayeredIndexImpl.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/LayeredIndexImpl.java @@ -18,7 +18,6 @@ import static java.util.Collections.singletonList; import com.google.common.collect.AbstractIterator; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -26,6 +25,7 @@ import java.util.function.Function; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; /** * Combines two {@link StoreIndex store indexes}, where one index serves as the "reference" and the diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/LazyIndexImpl.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/LazyIndexImpl.java index 9cae395b322..3a05fd505c9 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/LazyIndexImpl.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/LazyIndexImpl.java @@ -17,7 +17,6 @@ import static org.projectnessie.versioned.storage.common.util.SupplyOnce.memoize; -import com.google.protobuf.ByteString; import java.util.Iterator; import java.util.List; import java.util.Set; @@ -25,6 +24,7 @@ import java.util.function.Supplier; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.persist.ObjId; final class LazyIndexImpl implements StoreIndex { diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StoreIndex.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StoreIndex.java index ac2b83eb450..69dd1bd507b 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StoreIndex.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StoreIndex.java @@ -15,13 +15,13 @@ */ package org.projectnessie.versioned.storage.common.indexes; -import com.google.protobuf.ByteString; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.function.Function; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.persist.ObjId; /** diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StoreIndexImpl.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StoreIndexImpl.java index 0c8b6a465d7..892b93ded02 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StoreIndexImpl.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StoreIndexImpl.java @@ -17,16 +17,15 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; -import static com.google.protobuf.UnsafeByteOperations.unsafeWrap; import static java.util.Collections.binarySearch; import static java.util.Collections.singletonList; +import static org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations.unsafeWrap; import static org.projectnessie.versioned.storage.common.indexes.StoreIndexElement.indexElement; import static org.projectnessie.versioned.storage.common.util.JdkSpecifics.JDK_SPECIFIC; import static org.projectnessie.versioned.storage.common.util.Ser.putVarInt; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.AbstractIterator; -import com.google.protobuf.ByteString; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.AbstractList; @@ -38,6 +37,7 @@ import java.util.function.Function; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.persist.ObjId; import org.projectnessie.versioned.storage.common.util.Ser; diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StoreIndexes.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StoreIndexes.java index b452297e4b8..9bc174f300f 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StoreIndexes.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StoreIndexes.java @@ -18,10 +18,10 @@ import static com.google.common.base.Preconditions.checkArgument; import static org.projectnessie.versioned.storage.common.indexes.IndexLoader.notLoading; -import com.google.protobuf.ByteString; import java.util.List; import java.util.function.Supplier; import javax.annotation.Nonnull; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.objtypes.CommitObj; /** Factory methods for store indexes. */ diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StripedIndexImpl.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StripedIndexImpl.java index 0e3ea2323cf..c8250e0d1ec 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StripedIndexImpl.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/indexes/StripedIndexImpl.java @@ -20,7 +20,6 @@ import static java.util.Arrays.binarySearch; import com.google.common.collect.AbstractIterator; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -29,6 +28,7 @@ import java.util.function.Predicate; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; final class StripedIndexImpl implements StoreIndex { diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/CommitLogicImpl.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/CommitLogicImpl.java index 09be5d61877..3ccbcf0396a 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/CommitLogicImpl.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/CommitLogicImpl.java @@ -18,12 +18,12 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; import static com.google.common.collect.Sets.newHashSetWithExpectedSize; -import static com.google.protobuf.ByteString.copyFromUtf8; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Collections.emptyIterator; import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import static java.util.Objects.requireNonNull; +import static org.projectnessie.nessie.relocated.protobuf.ByteString.copyFromUtf8; import static org.projectnessie.versioned.storage.common.indexes.StoreIndexElement.indexElement; import static org.projectnessie.versioned.storage.common.indexes.StoreIndexes.indexFromStripes; import static org.projectnessie.versioned.storage.common.indexes.StoreIndexes.newStoreIndex; diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/IndexesLogicImpl.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/IndexesLogicImpl.java index 3e86bf999dd..90fdc1dcef1 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/IndexesLogicImpl.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/IndexesLogicImpl.java @@ -41,7 +41,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.AbstractIterator; -import com.google.protobuf.ByteString; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Deque; @@ -51,6 +50,7 @@ import java.util.function.Supplier; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; import org.projectnessie.versioned.storage.common.exceptions.ObjTooLargeException; import org.projectnessie.versioned.storage.common.indexes.IndexLoader; diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/PagingToken.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/PagingToken.java index b76b94d1953..9da992275f7 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/PagingToken.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/PagingToken.java @@ -15,13 +15,13 @@ */ package org.projectnessie.versioned.storage.common.logic; -import static com.google.protobuf.UnsafeByteOperations.unsafeWrap; +import static org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations.unsafeWrap; import static org.projectnessie.versioned.storage.common.util.Hex.hexChar; import static org.projectnessie.versioned.storage.common.util.Hex.nibble; -import com.google.protobuf.ByteString; import javax.annotation.Nonnull; import org.immutables.value.Value; +import org.projectnessie.nessie.relocated.protobuf.ByteString; @Value.Immutable public interface PagingToken { diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/ReferenceLogicImpl.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/ReferenceLogicImpl.java index b223773d4f4..342a60b1ec1 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/ReferenceLogicImpl.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/ReferenceLogicImpl.java @@ -18,10 +18,10 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; -import static com.google.protobuf.ByteString.copyFromUtf8; import static java.lang.String.format; import static java.util.Collections.emptyList; import static java.util.Objects.requireNonNull; +import static org.projectnessie.nessie.relocated.protobuf.ByteString.copyFromUtf8; import static org.projectnessie.versioned.storage.common.indexes.StoreKey.key; import static org.projectnessie.versioned.storage.common.logic.CommitConflict.ConflictType.KEY_EXISTS; import static org.projectnessie.versioned.storage.common.logic.CommitRetry.commitRetry; @@ -47,7 +47,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.AbstractIterator; -import com.google.protobuf.ByteString; import java.time.Instant; import java.util.ArrayList; import java.util.Iterator; @@ -55,6 +54,7 @@ import java.util.Optional; import java.util.function.Supplier; import javax.annotation.Nonnull; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.exceptions.CommitConflictException; import org.projectnessie.versioned.storage.common.exceptions.CommitWrappedException; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/RepositoryLogicImpl.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/RepositoryLogicImpl.java index f2dcfeb98eb..0f58b015fe3 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/RepositoryLogicImpl.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/logic/RepositoryLogicImpl.java @@ -15,9 +15,9 @@ */ package org.projectnessie.versioned.storage.common.logic; -import static com.google.protobuf.UnsafeByteOperations.unsafeWrap; import static java.util.Collections.emptyList; import static java.util.Objects.requireNonNull; +import static org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations.unsafeWrap; import static org.projectnessie.versioned.storage.common.logic.CreateCommit.Add.commitAdd; import static org.projectnessie.versioned.storage.common.logic.CreateCommit.newCommitBuilder; import static org.projectnessie.versioned.storage.common.logic.InternalRef.KEY_REPO_DESCRIPTION; @@ -33,13 +33,13 @@ import static org.projectnessie.versioned.storage.common.persist.Reference.reference; import static org.projectnessie.versioned.storage.common.util.Ser.SHARED_OBJECT_MAPPER; -import com.google.protobuf.ByteString; import java.io.IOException; import java.time.Instant; import java.util.Optional; import java.util.function.Consumer; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.exceptions.CommitConflictException; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; import org.projectnessie.versioned.storage.common.exceptions.ObjTooLargeException; diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/CommitObj.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/CommitObj.java index 0e2ffbc0c84..cacf5600070 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/CommitObj.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/CommitObj.java @@ -18,10 +18,10 @@ import static org.projectnessie.versioned.storage.common.persist.ObjId.EMPTY_OBJ_ID; import com.google.errorprone.annotations.CanIgnoreReturnValue; -import com.google.protobuf.ByteString; import java.util.List; import javax.annotation.Nullable; import org.immutables.value.Value; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.config.StoreConfig; import org.projectnessie.versioned.storage.common.indexes.ElementSerializer; import org.projectnessie.versioned.storage.common.indexes.StoreIndexes; diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/ContentValueObj.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/ContentValueObj.java index f8e0b669ac9..3534c9b6d6d 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/ContentValueObj.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/ContentValueObj.java @@ -18,10 +18,10 @@ import static com.google.common.base.Preconditions.checkArgument; import static org.projectnessie.versioned.storage.common.objtypes.Hashes.contentValueHash; -import com.google.protobuf.ByteString; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.immutables.value.Value; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.persist.Obj; import org.projectnessie.versioned.storage.common.persist.ObjId; import org.projectnessie.versioned.storage.common.persist.ObjType; diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/Hashes.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/Hashes.java index 3412581daa2..a699e64ad15 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/Hashes.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/Hashes.java @@ -25,8 +25,8 @@ import com.google.common.hash.Hasher; import com.google.common.hash.Hashing; -import com.google.protobuf.ByteString; import java.util.List; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.persist.ObjId; @SuppressWarnings("UnstableApiUsage") diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/IndexObj.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/IndexObj.java index c0763eeecd9..bc1327c1530 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/IndexObj.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/IndexObj.java @@ -17,10 +17,10 @@ import static org.projectnessie.versioned.storage.common.objtypes.Hashes.indexHash; -import com.google.protobuf.ByteString; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.immutables.value.Value; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.persist.Obj; import org.projectnessie.versioned.storage.common.persist.ObjId; import org.projectnessie.versioned.storage.common.persist.ObjType; diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/StringObj.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/StringObj.java index bd10651eb32..1366277c6d9 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/StringObj.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/StringObj.java @@ -17,10 +17,10 @@ import static org.projectnessie.versioned.storage.common.objtypes.Hashes.stringDataHash; -import com.google.protobuf.ByteString; import java.util.List; import javax.annotation.Nullable; import org.immutables.value.Value; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.persist.Obj; import org.projectnessie.versioned.storage.common.persist.ObjId; import org.projectnessie.versioned.storage.common.persist.ObjType; diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/TagObj.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/TagObj.java index 37c7f963243..7094fbc5124 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/TagObj.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/objtypes/TagObj.java @@ -17,9 +17,9 @@ import static org.projectnessie.versioned.storage.common.objtypes.Hashes.tagHash; -import com.google.protobuf.ByteString; import javax.annotation.Nullable; import org.immutables.value.Value; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.persist.Obj; import org.projectnessie.versioned.storage.common.persist.ObjId; import org.projectnessie.versioned.storage.common.persist.ObjType; diff --git a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/persist/ObjId.java b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/persist/ObjId.java index e6bbeb9cd79..ceab003f9d6 100644 --- a/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/persist/ObjId.java +++ b/versioned/storage/common/src/main/java/org/projectnessie/versioned/storage/common/persist/ObjId.java @@ -16,8 +16,8 @@ package org.projectnessie.versioned.storage.common.persist; import static com.google.common.base.Preconditions.checkArgument; -import static com.google.protobuf.UnsafeByteOperations.unsafeWrap; import static java.util.Objects.requireNonNull; +import static org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations.unsafeWrap; import static org.projectnessie.versioned.storage.common.util.Hex.hexChar; import static org.projectnessie.versioned.storage.common.util.Hex.nibble; import static org.projectnessie.versioned.storage.common.util.Hex.nibbleFromLong; @@ -28,11 +28,11 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.hash.Hashing; -import com.google.protobuf.ByteString; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.concurrent.ThreadLocalRandom; import javax.annotation.Nonnull; +import org.projectnessie.nessie.relocated.protobuf.ByteString; public abstract class ObjId { // TODO Should this class actually be merged with the existing `Hash` class, diff --git a/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/indexes/TestImmutableEmptyIndexImpl.java b/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/indexes/TestImmutableEmptyIndexImpl.java index 9dd4896ab44..d2a1b9eb3ba 100644 --- a/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/indexes/TestImmutableEmptyIndexImpl.java +++ b/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/indexes/TestImmutableEmptyIndexImpl.java @@ -23,12 +23,12 @@ import static org.projectnessie.versioned.storage.common.objtypes.CommitOp.COMMIT_OP_SERIALIZER; import static org.projectnessie.versioned.storage.common.objtypes.CommitOp.commitOp; -import com.google.protobuf.ByteString; import org.assertj.core.api.SoftAssertions; import org.assertj.core.api.junit.jupiter.InjectSoftAssertions; import org.assertj.core.api.junit.jupiter.SoftAssertionsExtension; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.objtypes.CommitOp; import org.projectnessie.versioned.storage.common.persist.ObjId; diff --git a/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/logic/TestPagingToken.java b/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/logic/TestPagingToken.java index b8e746313b3..a53a56e4390 100644 --- a/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/logic/TestPagingToken.java +++ b/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/logic/TestPagingToken.java @@ -15,13 +15,12 @@ */ package org.projectnessie.versioned.storage.common.logic; -import static com.google.protobuf.UnsafeByteOperations.unsafeWrap; import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations.unsafeWrap; import static org.projectnessie.versioned.storage.common.logic.PagingToken.emptyPagingToken; import static org.projectnessie.versioned.storage.common.logic.PagingToken.pagingToken; -import com.google.protobuf.ByteString; import java.util.stream.Stream; import org.assertj.core.api.SoftAssertions; import org.assertj.core.api.junit.jupiter.InjectSoftAssertions; @@ -31,6 +30,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.projectnessie.nessie.relocated.protobuf.ByteString; @ExtendWith(SoftAssertionsExtension.class) public class TestPagingToken { diff --git a/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/logic/TestReferenceIndexes.java b/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/logic/TestReferenceIndexes.java index 093bf429324..af3b748c2dc 100644 --- a/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/logic/TestReferenceIndexes.java +++ b/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/logic/TestReferenceIndexes.java @@ -16,7 +16,6 @@ package org.projectnessie.versioned.storage.common.logic; import static com.google.common.collect.Lists.newArrayList; -import static com.google.protobuf.ByteString.copyFromUtf8; import static java.lang.String.format; import static java.util.Arrays.asList; import static java.util.Collections.emptyList; @@ -28,6 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.InstanceOfAssertFactories.list; import static org.assertj.core.api.InstanceOfAssertFactories.type; +import static org.projectnessie.nessie.relocated.protobuf.ByteString.copyFromUtf8; import static org.projectnessie.versioned.storage.common.config.StoreConfig.CONFIG_MAX_INCREMENTAL_INDEX_SIZE; import static org.projectnessie.versioned.storage.common.config.StoreConfig.CONFIG_MAX_REFERENCE_STRIPES_PER_COMMIT; import static org.projectnessie.versioned.storage.common.config.StoreConfig.CONFIG_MAX_SERIALIZED_INDEX_SIZE; diff --git a/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/objtypes/TestObjTypes.java b/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/objtypes/TestObjTypes.java index 0ee0d9a60c5..e64e47667a1 100644 --- a/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/objtypes/TestObjTypes.java +++ b/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/objtypes/TestObjTypes.java @@ -15,11 +15,11 @@ */ package org.projectnessie.versioned.storage.common.objtypes; -import static com.google.protobuf.ByteString.copyFromUtf8; import static java.util.Arrays.asList; import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.projectnessie.nessie.relocated.protobuf.ByteString.copyFromUtf8; import static org.projectnessie.versioned.storage.common.indexes.StoreIndexElement.indexElement; import static org.projectnessie.versioned.storage.common.indexes.StoreIndexes.emptyImmutableIndex; import static org.projectnessie.versioned.storage.common.indexes.StoreIndexes.newStoreIndex; @@ -49,7 +49,6 @@ import static org.projectnessie.versioned.storage.common.persist.ObjType.TAG; import static org.projectnessie.versioned.storage.common.persist.ObjType.VALUE; -import com.google.protobuf.ByteString; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -61,6 +60,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.indexes.StoreIndex; import org.projectnessie.versioned.storage.common.persist.Obj; import org.projectnessie.versioned.storage.common.persist.ObjType; diff --git a/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/persist/TestObjId.java b/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/persist/TestObjId.java index 1e3a12066ae..057f44dcde3 100644 --- a/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/persist/TestObjId.java +++ b/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/persist/TestObjId.java @@ -25,7 +25,6 @@ import static org.projectnessie.versioned.storage.common.persist.ObjId.objIdFromString; import com.google.common.hash.Hashing; -import com.google.protobuf.ByteString; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.Locale; @@ -39,6 +38,7 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.persist.ObjId.ObjId256; import org.projectnessie.versioned.storage.common.persist.ObjId.ObjIdEmpty; import org.projectnessie.versioned.storage.common.persist.ObjId.ObjIdGeneric; diff --git a/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/util/Util.java b/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/util/Util.java index 2cfdaa6c6d8..f5bf45b42e2 100644 --- a/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/util/Util.java +++ b/versioned/storage/common/src/test/java/org/projectnessie/versioned/storage/common/util/Util.java @@ -18,8 +18,8 @@ import static org.projectnessie.versioned.storage.common.util.Ser.putVarInt; import static org.projectnessie.versioned.storage.common.util.Ser.varIntLen; -import com.google.protobuf.ByteString; import java.nio.ByteBuffer; +import org.projectnessie.nessie.relocated.protobuf.ByteString; public final class Util { private Util() {} diff --git a/versioned/storage/dynamodb/build.gradle.kts b/versioned/storage/dynamodb/build.gradle.kts index e8c0e6db0cd..3ffe8467e6a 100644 --- a/versioned/storage/dynamodb/build.gradle.kts +++ b/versioned/storage/dynamodb/build.gradle.kts @@ -43,7 +43,6 @@ dependencies { implementation(libs.guava) implementation(libs.slf4j.api) - implementation(libs.protobuf.java) implementation(platform(libs.awssdk.bom)) implementation(libs.awssdk.dynamodb) { exclude("software.amazon.awssdk", "apache-client") } implementation(libs.awssdk.netty.nio.client) diff --git a/versioned/storage/dynamodb/src/intTest/java/org/projectnessie/versioned/storage/dynamodb/ITDynamoDBPersist.java b/versioned/storage/dynamodb/src/intTest/java/org/projectnessie/versioned/storage/dynamodb/ITDynamoDBPersist.java index 5de853b032b..732539f6eba 100644 --- a/versioned/storage/dynamodb/src/intTest/java/org/projectnessie/versioned/storage/dynamodb/ITDynamoDBPersist.java +++ b/versioned/storage/dynamodb/src/intTest/java/org/projectnessie/versioned/storage/dynamodb/ITDynamoDBPersist.java @@ -17,12 +17,12 @@ import static org.projectnessie.versioned.storage.common.objtypes.ContentValueObj.contentValue; -import com.google.protobuf.ByteString; import org.assertj.core.api.SoftAssertions; import org.assertj.core.api.junit.jupiter.InjectSoftAssertions; import org.assertj.core.api.junit.jupiter.SoftAssertionsExtension; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.exceptions.ObjTooLargeException; import org.projectnessie.versioned.storage.common.persist.Obj; import org.projectnessie.versioned.storage.common.persist.ObjId; diff --git a/versioned/storage/dynamodb/src/main/java/org/projectnessie/versioned/storage/dynamodb/DynamoDBPersist.java b/versioned/storage/dynamodb/src/main/java/org/projectnessie/versioned/storage/dynamodb/DynamoDBPersist.java index 015fcdc2942..f0d08bb2d32 100644 --- a/versioned/storage/dynamodb/src/main/java/org/projectnessie/versioned/storage/dynamodb/DynamoDBPersist.java +++ b/versioned/storage/dynamodb/src/main/java/org/projectnessie/versioned/storage/dynamodb/DynamoDBPersist.java @@ -17,9 +17,9 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; -import static com.google.protobuf.UnsafeByteOperations.unsafeWrap; import static java.util.Collections.emptyListIterator; import static java.util.Collections.singletonMap; +import static org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations.unsafeWrap; import static org.projectnessie.versioned.storage.common.indexes.StoreKey.keyFromString; import static org.projectnessie.versioned.storage.common.objtypes.CommitHeaders.newCommitHeaders; import static org.projectnessie.versioned.storage.common.objtypes.CommitObj.commitBuilder; @@ -91,7 +91,6 @@ import static software.amazon.awssdk.services.dynamodb.model.ComparisonOperator.IN; import com.google.common.collect.AbstractIterator; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.EnumMap; import java.util.HashMap; @@ -107,6 +106,7 @@ import javax.annotation.Nullable; import org.agrona.collections.Hashing; import org.agrona.collections.Object2IntHashMap; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.config.StoreConfig; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; import org.projectnessie.versioned.storage.common.exceptions.ObjTooLargeException; diff --git a/versioned/storage/inmemory/build.gradle.kts b/versioned/storage/inmemory/build.gradle.kts index c0cfebcbeb2..8d73d9cf1f4 100644 --- a/versioned/storage/inmemory/build.gradle.kts +++ b/versioned/storage/inmemory/build.gradle.kts @@ -28,6 +28,7 @@ description = "Storage implementation using in-memory maps, not persisting." dependencies { implementation(project(":nessie-versioned-storage-common")) + implementation(project(path = ":nessie-protobuf-relocated", configuration = "shadow")) // javax/jakarta compileOnly(libs.jakarta.validation.api) @@ -37,7 +38,6 @@ dependencies { compileOnly(libs.errorprone.annotations) implementation(libs.guava) - implementation(libs.protobuf.java) compileOnly(project(":nessie-versioned-storage-testextension")) diff --git a/versioned/storage/inmemory/src/main/java/org/projectnessie/versioned/storage/inmemory/InmemoryPersist.java b/versioned/storage/inmemory/src/main/java/org/projectnessie/versioned/storage/inmemory/InmemoryPersist.java index a5c73693d6c..3c3c4f1c583 100644 --- a/versioned/storage/inmemory/src/main/java/org/projectnessie/versioned/storage/inmemory/InmemoryPersist.java +++ b/versioned/storage/inmemory/src/main/java/org/projectnessie/versioned/storage/inmemory/InmemoryPersist.java @@ -19,7 +19,6 @@ import static org.projectnessie.versioned.storage.common.persist.Reference.reference; import com.google.common.collect.AbstractIterator; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -28,6 +27,7 @@ import java.util.function.Consumer; import java.util.function.Predicate; import javax.annotation.Nonnull; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.config.StoreConfig; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; import org.projectnessie.versioned.storage.common.exceptions.ObjTooLargeException; diff --git a/versioned/storage/jdbc/build.gradle.kts b/versioned/storage/jdbc/build.gradle.kts index a1c8b31c622..3703a28d854 100644 --- a/versioned/storage/jdbc/build.gradle.kts +++ b/versioned/storage/jdbc/build.gradle.kts @@ -41,7 +41,6 @@ dependencies { compileOnly(libs.errorprone.annotations) implementation(libs.guava) implementation(libs.agrona) - implementation(libs.protobuf.java) implementation(libs.slf4j.api) compileOnly(libs.immutables.builder) diff --git a/versioned/storage/jdbc/src/main/java/org/projectnessie/versioned/storage/jdbc/AbstractJdbcPersist.java b/versioned/storage/jdbc/src/main/java/org/projectnessie/versioned/storage/jdbc/AbstractJdbcPersist.java index 9d7fc73bf82..f2806753d31 100644 --- a/versioned/storage/jdbc/src/main/java/org/projectnessie/versioned/storage/jdbc/AbstractJdbcPersist.java +++ b/versioned/storage/jdbc/src/main/java/org/projectnessie/versioned/storage/jdbc/AbstractJdbcPersist.java @@ -17,8 +17,8 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; -import static com.google.protobuf.UnsafeByteOperations.unsafeWrap; import static java.util.Objects.requireNonNull; +import static org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations.unsafeWrap; import static org.projectnessie.versioned.storage.common.indexes.StoreKey.keyFromString; import static org.projectnessie.versioned.storage.common.objtypes.ContentValueObj.contentValue; import static org.projectnessie.versioned.storage.common.objtypes.IndexObj.index; @@ -84,7 +84,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.AbstractIterator; -import com.google.protobuf.ByteString; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; @@ -104,6 +103,7 @@ import org.agrona.collections.Hashing; import org.agrona.collections.Int2IntHashMap; import org.agrona.collections.Object2IntHashMap; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.config.StoreConfig; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; import org.projectnessie.versioned.storage.common.exceptions.ObjTooLargeException; diff --git a/versioned/storage/mongodb/build.gradle.kts b/versioned/storage/mongodb/build.gradle.kts index 18f07c8baa7..b20c5883c12 100644 --- a/versioned/storage/mongodb/build.gradle.kts +++ b/versioned/storage/mongodb/build.gradle.kts @@ -43,7 +43,6 @@ dependencies { implementation(libs.guava) implementation(libs.slf4j.api) - implementation(libs.protobuf.java) implementation(libs.mongodb.driver.sync) compileOnly(libs.testcontainers.mongodb) diff --git a/versioned/storage/mongodb/src/main/java/org/projectnessie/versioned/storage/mongodb/MongoDBPersist.java b/versioned/storage/mongodb/src/main/java/org/projectnessie/versioned/storage/mongodb/MongoDBPersist.java index 32ca6eefc6f..6d50212b49f 100644 --- a/versioned/storage/mongodb/src/main/java/org/projectnessie/versioned/storage/mongodb/MongoDBPersist.java +++ b/versioned/storage/mongodb/src/main/java/org/projectnessie/versioned/storage/mongodb/MongoDBPersist.java @@ -17,7 +17,6 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; -import static com.google.protobuf.UnsafeByteOperations.unsafeWrap; import static com.mongodb.ErrorCategory.DUPLICATE_KEY; import static com.mongodb.client.model.Filters.and; import static com.mongodb.client.model.Filters.eq; @@ -25,6 +24,7 @@ import static com.mongodb.client.model.Updates.set; import static java.util.Collections.emptyList; import static java.util.stream.Collectors.toList; +import static org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations.unsafeWrap; import static org.projectnessie.versioned.storage.common.indexes.StoreKey.keyFromString; import static org.projectnessie.versioned.storage.common.objtypes.CommitHeaders.newCommitHeaders; import static org.projectnessie.versioned.storage.common.objtypes.CommitObj.commitBuilder; @@ -83,7 +83,6 @@ import static org.projectnessie.versioned.storage.mongodb.MongoDBConstants.ID_REPO_PATH; import com.google.common.collect.AbstractIterator; -import com.google.protobuf.ByteString; import com.mongodb.MongoBulkWriteException; import com.mongodb.MongoWriteException; import com.mongodb.bulk.BulkWriteError; @@ -110,6 +109,7 @@ import org.bson.Document; import org.bson.conversions.Bson; import org.bson.types.Binary; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.config.StoreConfig; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; import org.projectnessie.versioned.storage.common.exceptions.ObjTooLargeException; diff --git a/versioned/storage/rocksdb/build.gradle.kts b/versioned/storage/rocksdb/build.gradle.kts index 76965c51f90..5ae09bdca19 100644 --- a/versioned/storage/rocksdb/build.gradle.kts +++ b/versioned/storage/rocksdb/build.gradle.kts @@ -39,7 +39,6 @@ dependencies { compileOnly(libs.errorprone.annotations) implementation(libs.guava) - implementation(libs.protobuf.java) implementation(libs.rocksdb.jni) compileOnly(libs.immutables.builder) diff --git a/versioned/storage/rocksdb/src/main/java/org/projectnessie/versioned/storage/rocksdb/RocksDBPersist.java b/versioned/storage/rocksdb/src/main/java/org/projectnessie/versioned/storage/rocksdb/RocksDBPersist.java index 22c9277a703..a8cc9e313c1 100644 --- a/versioned/storage/rocksdb/src/main/java/org/projectnessie/versioned/storage/rocksdb/RocksDBPersist.java +++ b/versioned/storage/rocksdb/src/main/java/org/projectnessie/versioned/storage/rocksdb/RocksDBPersist.java @@ -24,7 +24,6 @@ import static org.projectnessie.versioned.storage.serialize.ProtoSerialization.serializeReference; import com.google.common.collect.AbstractIterator; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -32,6 +31,7 @@ import java.util.concurrent.locks.Lock; import java.util.function.Predicate; import javax.annotation.Nonnull; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.config.StoreConfig; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; import org.projectnessie.versioned.storage.common.exceptions.ObjTooLargeException; diff --git a/versioned/storage/store/build.gradle.kts b/versioned/storage/store/build.gradle.kts index a820c135333..3a92cb90355 100644 --- a/versioned/storage/store/build.gradle.kts +++ b/versioned/storage/store/build.gradle.kts @@ -30,7 +30,7 @@ dependencies { implementation(project(":nessie-versioned-storage-common")) implementation(project(":nessie-model")) implementation(project(":nessie-versioned-spi")) - implementation(libs.protobuf.java) + implementation(project(path = ":nessie-protobuf-relocated", configuration = "shadow")) implementation(libs.agrona) // javax/jakarta diff --git a/versioned/storage/store/src/main/java/org/projectnessie/versioned/storage/versionstore/ContentMapping.java b/versioned/storage/store/src/main/java/org/projectnessie/versioned/storage/versionstore/ContentMapping.java index 48201fcfd50..d0fc955458c 100644 --- a/versioned/storage/store/src/main/java/org/projectnessie/versioned/storage/versionstore/ContentMapping.java +++ b/versioned/storage/store/src/main/java/org/projectnessie/versioned/storage/versionstore/ContentMapping.java @@ -24,7 +24,6 @@ import static org.projectnessie.versioned.storage.versionstore.TypeMapping.storeKeyToKey; import static org.projectnessie.versioned.storage.versionstore.TypeMapping.toCommitMeta; -import com.google.protobuf.ByteString; import java.util.HashMap; import java.util.Map; import java.util.stream.Stream; @@ -32,6 +31,7 @@ import org.projectnessie.model.CommitMeta; import org.projectnessie.model.Content; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.Commit; import org.projectnessie.versioned.Delete; import org.projectnessie.versioned.ImmutableCommit; diff --git a/versioned/storage/store/src/main/java/org/projectnessie/versioned/storage/versionstore/VersionStoreImpl.java b/versioned/storage/store/src/main/java/org/projectnessie/versioned/storage/versionstore/VersionStoreImpl.java index a644055d443..3d449dbd123 100644 --- a/versioned/storage/store/src/main/java/org/projectnessie/versioned/storage/versionstore/VersionStoreImpl.java +++ b/versioned/storage/store/src/main/java/org/projectnessie/versioned/storage/versionstore/VersionStoreImpl.java @@ -15,10 +15,10 @@ */ package org.projectnessie.versioned.storage.versionstore; -import static com.google.protobuf.ByteString.copyFromUtf8; import static java.util.Collections.emptyMap; import static java.util.Collections.singleton; import static java.util.Objects.requireNonNull; +import static org.projectnessie.nessie.relocated.protobuf.ByteString.copyFromUtf8; import static org.projectnessie.versioned.storage.common.indexes.StoreKey.keyFromString; import static org.projectnessie.versioned.storage.common.logic.CommitLogQuery.commitLogQuery; import static org.projectnessie.versioned.storage.common.logic.DiffQuery.diffQuery; diff --git a/versioned/tests/build.gradle.kts b/versioned/tests/build.gradle.kts index 56a89c373bf..adf67f272b4 100644 --- a/versioned/tests/build.gradle.kts +++ b/versioned/tests/build.gradle.kts @@ -28,7 +28,6 @@ dependencies { implementation(project(":nessie-versioned-spi")) implementation(libs.guava) implementation(libs.slf4j.api) - implementation(libs.protobuf.java) compileOnly(libs.immutables.value.annotations) annotationProcessor(libs.immutables.value.processor) diff --git a/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/OnRefOnly.java b/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/OnRefOnly.java index 11de9af66c0..e556441420a 100644 --- a/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/OnRefOnly.java +++ b/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/OnRefOnly.java @@ -15,10 +15,10 @@ */ package org.projectnessie.versioned.testworker; -import com.google.protobuf.ByteString; import org.immutables.value.Value; import org.projectnessie.model.Content; import org.projectnessie.model.types.ContentTypes; +import org.projectnessie.nessie.relocated.protobuf.ByteString; /** Content with on-reference state only. */ @Value.Immutable diff --git a/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/OnRefOnlySerializer.java b/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/OnRefOnlySerializer.java index f8cbeb24aa6..d8093407d5a 100644 --- a/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/OnRefOnlySerializer.java +++ b/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/OnRefOnlySerializer.java @@ -18,11 +18,11 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.projectnessie.versioned.testworker.OnRefOnly.onRef; -import com.google.protobuf.ByteString; import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Stream; import org.projectnessie.model.Content; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachmentKey; diff --git a/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/TestContentSerializer.java b/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/TestContentSerializer.java index b4ea3306a3f..b50939c8e8d 100644 --- a/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/TestContentSerializer.java +++ b/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/TestContentSerializer.java @@ -17,12 +17,12 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.google.protobuf.ByteString; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Stream; import org.projectnessie.model.Content; import org.projectnessie.model.types.ContentTypes; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachmentKey; import org.projectnessie.versioned.store.ContentSerializer; diff --git a/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/WithAttachmentsSerializer.java b/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/WithAttachmentsSerializer.java index 6814eb1e086..b5edf9a8d38 100644 --- a/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/WithAttachmentsSerializer.java +++ b/versioned/tests/src/main/java/org/projectnessie/versioned/testworker/WithAttachmentsSerializer.java @@ -18,12 +18,12 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.projectnessie.versioned.testworker.WithAttachmentsContent.withAttachments; -import com.google.protobuf.ByteString; import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import org.projectnessie.model.Content; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.ContentAttachment; import org.projectnessie.versioned.ContentAttachmentKey; diff --git a/versioned/transfer-proto/build.gradle.kts b/versioned/transfer-proto/build.gradle.kts index a71dfadbf73..e0dbffd7354 100644 --- a/versioned/transfer-proto/build.gradle.kts +++ b/versioned/transfer-proto/build.gradle.kts @@ -14,7 +14,9 @@ * limitations under the License. */ +import com.google.protobuf.gradle.GenerateProtoTask import com.google.protobuf.gradle.ProtobufExtension +import com.google.protobuf.gradle.ProtobufExtract plugins { `java-library` @@ -22,13 +24,12 @@ plugins { signing id("org.projectnessie.buildsupport.reflectionconfig") `nessie-conventions` + alias(libs.plugins.protobuf) } -apply() - extra["maven.name"] = "Nessie - Export/Import - Serialization (Proto)" -dependencies { implementation(libs.protobuf.java) } +dependencies { api(project(path = ":nessie-protobuf-relocated", configuration = "shadow")) } extensions.configure { // Configure the protoc executable @@ -38,16 +39,28 @@ extensions.configure { } } +tasks.named("generateProto") { + doLast { + fileTree("$buildDir/generated/source/proto/main").forEach { + it.writeText( + it.readText().replace("com.google.protobuf", "org.projectnessie.nessie.relocated.protobuf") + ) + } + } +} + reflectionConfig { // Consider classes that extend one of these classes... classExtendsPatterns.set( listOf( - "com.google.protobuf.GeneratedMessageV3", - "com.google.protobuf.GeneratedMessageV3.Builder" + "org.projectnessie.nessie.relocated.protobuf.GeneratedMessageV3", + "org.projectnessie.nessie.relocated.protobuf.GeneratedMessageV3.Builder" ) ) // ... and classes the implement this interface. - classImplementsPatterns.set(listOf("com.google.protobuf.ProtocolMessageEnum")) + classImplementsPatterns.set( + listOf("org.projectnessie.nessie.relocated.protobuf.ProtocolMessageEnum") + ) // Also include generated classes (e.g. google.protobuf.Empty) via the "runtimeClasspath", // which contains the the "com.google.protobuf:protobuf-java" dependency. includeConfigurations.set(listOf("runtimeClasspath")) diff --git a/versioned/transfer-proto/src/main/proto/transfer.proto b/versioned/transfer-proto/src/main/proto/org/projectnessie/versioned/transfer/serialize/transfer.proto similarity index 100% rename from versioned/transfer-proto/src/main/proto/transfer.proto rename to versioned/transfer-proto/src/main/proto/org/projectnessie/versioned/transfer/serialize/transfer.proto diff --git a/versioned/transfer/build.gradle.kts b/versioned/transfer/build.gradle.kts index 431890740bb..ecd5bc35ef9 100644 --- a/versioned/transfer/build.gradle.kts +++ b/versioned/transfer/build.gradle.kts @@ -31,12 +31,9 @@ dependencies { implementation(project(":nessie-versioned-spi")) implementation(project(":nessie-versioned-persist-adapter")) implementation(project(":nessie-versioned-transfer-proto")) - implementation(project(":nessie-versioned-storage-common")) implementation(project(":nessie-versioned-storage-store")) - implementation(libs.protobuf.java) - implementation(platform(libs.jackson.bom)) implementation(libs.jackson.databind) implementation(libs.jackson.annotations) diff --git a/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ExportDatabaseAdapter.java b/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ExportDatabaseAdapter.java index 60c9a4d0fc6..b8aa36d3b7f 100644 --- a/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ExportDatabaseAdapter.java +++ b/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ExportDatabaseAdapter.java @@ -19,12 +19,12 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.google.errorprone.annotations.MustBeClosed; -import com.google.protobuf.ByteString; import java.util.Iterator; import java.util.function.Consumer; import java.util.stream.Stream; import org.projectnessie.model.Content; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.GetNamedRefsParams; import org.projectnessie.versioned.NamedRef; diff --git a/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ExportPersist.java b/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ExportPersist.java index 319d10c12c1..43e6a06c416 100644 --- a/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ExportPersist.java +++ b/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ExportPersist.java @@ -25,12 +25,12 @@ import static org.projectnessie.versioned.storage.common.persist.ObjType.VALUE; import com.fasterxml.jackson.core.JsonProcessingException; -import com.google.protobuf.ByteString; import java.io.IOException; import java.util.Iterator; import java.util.function.Consumer; import java.util.stream.Stream; import org.projectnessie.model.Content; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; import org.projectnessie.versioned.storage.common.logic.CommitLogic; import org.projectnessie.versioned.storage.common.logic.HeadsAndForkPoints; diff --git a/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ImportDatabaseAdapter.java b/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ImportDatabaseAdapter.java index 3adc4ed637d..1b48c9908e2 100644 --- a/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ImportDatabaseAdapter.java +++ b/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ImportDatabaseAdapter.java @@ -18,13 +18,13 @@ import static com.google.common.base.Preconditions.checkState; import static java.util.Objects.requireNonNull; -import com.google.protobuf.ByteString; import java.io.IOException; import java.io.InputStream; import java.util.Optional; import org.projectnessie.model.CommitMeta; import org.projectnessie.model.Content; import org.projectnessie.model.ContentKey; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.CommitMetaSerializer; import org.projectnessie.versioned.ContentAttachment; diff --git a/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ImportPersistCommon.java b/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ImportPersistCommon.java index 0dcdde90d14..2d35f1d8a63 100644 --- a/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ImportPersistCommon.java +++ b/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/ImportPersistCommon.java @@ -24,10 +24,10 @@ import static org.projectnessie.versioned.storage.common.objtypes.CommitOp.contentIdMaybe; import static org.projectnessie.versioned.storage.common.objtypes.ContentValueObj.contentValue; -import com.google.protobuf.ByteString; import java.io.IOException; import java.io.InputStream; import org.projectnessie.model.Content; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.storage.common.exceptions.ObjNotFoundException; import org.projectnessie.versioned.storage.common.indexes.StoreIndex; import org.projectnessie.versioned.storage.common.indexes.StoreKey; diff --git a/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/SizeLimitedOutput.java b/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/SizeLimitedOutput.java index 3b4b329e0ba..dc24d9a4e9c 100644 --- a/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/SizeLimitedOutput.java +++ b/versioned/transfer/src/main/java/org/projectnessie/versioned/transfer/SizeLimitedOutput.java @@ -15,12 +15,12 @@ */ package org.projectnessie.versioned.transfer; -import com.google.protobuf.AbstractMessage; import java.io.BufferedOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.function.Consumer; import java.util.function.LongConsumer; +import org.projectnessie.nessie.relocated.protobuf.AbstractMessage; import org.projectnessie.versioned.transfer.files.ExportFileSupplier; final class SizeLimitedOutput { diff --git a/versioned/transfer/src/test/java/org/projectnessie/versioned/transfer/TestSizeLimitedOutput.java b/versioned/transfer/src/test/java/org/projectnessie/versioned/transfer/TestSizeLimitedOutput.java index 28b20ce5e5e..b6d009445b9 100644 --- a/versioned/transfer/src/test/java/org/projectnessie/versioned/transfer/TestSizeLimitedOutput.java +++ b/versioned/transfer/src/test/java/org/projectnessie/versioned/transfer/TestSizeLimitedOutput.java @@ -21,7 +21,6 @@ import static org.mockito.Mockito.when; import com.google.common.base.Strings; -import com.google.protobuf.AbstractMessage; import java.io.ByteArrayOutputStream; import java.io.OutputStream; import java.nio.file.Path; @@ -40,6 +39,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import org.projectnessie.nessie.relocated.protobuf.AbstractMessage; import org.projectnessie.versioned.transfer.files.ExportFileSupplier; import org.projectnessie.versioned.transfer.serialize.TransferTypes.ExportMeta; import org.projectnessie.versioned.transfer.serialize.TransferTypes.NamedReference; diff --git a/versioned/transfer/src/testFixtures/java/org/projectnessie/versioned/transfer/AbstractITCommitLogOptimization.java b/versioned/transfer/src/testFixtures/java/org/projectnessie/versioned/transfer/AbstractITCommitLogOptimization.java index 12ea86ac350..8aab8196d25 100644 --- a/versioned/transfer/src/testFixtures/java/org/projectnessie/versioned/transfer/AbstractITCommitLogOptimization.java +++ b/versioned/transfer/src/testFixtures/java/org/projectnessie/versioned/transfer/AbstractITCommitLogOptimization.java @@ -18,7 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.params.provider.Arguments.arguments; -import com.google.protobuf.ByteString; import java.nio.file.Path; import java.util.List; import java.util.Optional; @@ -33,6 +32,7 @@ import org.projectnessie.model.Content; import org.projectnessie.model.ContentKey; import org.projectnessie.model.IcebergTable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.CommitMetaSerializer; import org.projectnessie.versioned.GetNamedRefsParams; diff --git a/versioned/transfer/src/testFixtures/java/org/projectnessie/versioned/transfer/BaseExportImport.java b/versioned/transfer/src/testFixtures/java/org/projectnessie/versioned/transfer/BaseExportImport.java index 7dd1755e53a..895dd77da10 100644 --- a/versioned/transfer/src/testFixtures/java/org/projectnessie/versioned/transfer/BaseExportImport.java +++ b/versioned/transfer/src/testFixtures/java/org/projectnessie/versioned/transfer/BaseExportImport.java @@ -20,7 +20,6 @@ import static org.junit.jupiter.params.provider.Arguments.arguments; import com.google.errorprone.annotations.MustBeClosed; -import com.google.protobuf.ByteString; import java.io.IOException; import java.nio.file.Path; import java.time.Instant; @@ -46,6 +45,7 @@ import org.projectnessie.model.Content; import org.projectnessie.model.ContentKey; import org.projectnessie.model.IcebergTable; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.BranchName; import org.projectnessie.versioned.Commit; import org.projectnessie.versioned.GetNamedRefsParams; diff --git a/versioned/transfer/src/testFixtures/java/org/projectnessie/versioned/transfer/ExportImportTestUtil.java b/versioned/transfer/src/testFixtures/java/org/projectnessie/versioned/transfer/ExportImportTestUtil.java index d0f732d04c5..ec6d444ae61 100644 --- a/versioned/transfer/src/testFixtures/java/org/projectnessie/versioned/transfer/ExportImportTestUtil.java +++ b/versioned/transfer/src/testFixtures/java/org/projectnessie/versioned/transfer/ExportImportTestUtil.java @@ -19,12 +19,12 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.projectnessie.model.CommitMeta; import org.projectnessie.model.ser.Views; +import org.projectnessie.nessie.relocated.protobuf.ByteString; import org.projectnessie.versioned.Hash; import org.projectnessie.versioned.persist.adapter.CommitLogEntry;