From f27edbfd636cc753cdd2f5d12dfc5382934fd1b3 Mon Sep 17 00:00:00 2001 From: Anatolii Popov Date: Mon, 18 Mar 2024 16:29:04 +0200 Subject: [PATCH] Validating runtime dependencies for conflicts --- Makefile | 6 ++-- build.gradle | 30 +++++++++++------- core/build.gradle | 6 ++-- docker/Dockerfile | 6 ++-- settings.gradle | 9 +++--- storage/{ => plugins}/azure/build.gradle | 12 +++---- .../azure/AzureBlobStorageAccountKeyTest.java | 0 .../AzureBlobStorageConnectionStringTest.java | 0 .../azure/AzureBlobStorageMetricsTest.java | 0 .../azure/AzureBlobStorageSasTokenTest.java | 0 .../storage/azure/AzureBlobStorageTest.java | 0 .../azure/AzuriteBlobStorageUtils.java | 0 .../resources/log4j.properties | 0 .../storage/azure/AzureBlobStorage.java | 0 .../storage/azure/AzureBlobStorageConfig.java | 0 .../storage/azure/MetricCollector.java | 0 .../azure/AzureBlobStorageConfigTest.java | 0 .../storage/azure/MetricCollectorTest.java | 0 .../azure/src/test/resources/log4j.properties | 0 storage/plugins/build.gradle | 31 +++++++++++++++++++ storage/{ => plugins}/filesystem/build.gradle | 4 --- .../storage/filesystem/FileSystemStorage.java | 0 .../filesystem/FileSystemStorageConfig.java | 0 .../FileSystemStorageConfigTest.java | 0 .../filesystem/FileSystemStorageTest.java | 0 .../src/test/resources/log4j.properties | 0 storage/{ => plugins}/gcs/build.gradle | 12 +++---- .../storage/gcs/GcsStorageMetricsTest.java | 0 .../storage/gcs/GcsStorageTest.java | 0 .../resources/log4j.properties | 0 .../storage/gcs/CredentialsBuilder.java | 0 .../tieredstorage/storage/gcs/GcsStorage.java | 0 .../storage/gcs/GcsStorageConfig.java | 0 .../storage/gcs/MetricCollector.java | 0 .../storage/gcs/CredentialsBuilderTest.java | 0 .../storage/gcs/GcsStorageConfigTest.java | 0 .../storage/gcs/MetricCollectorRegexTest.java | 0 .../gcs/src/test/resources/log4j.properties | 0 .../test/resources/test_gcs_credentials.json | 0 storage/{ => plugins}/s3/build.gradle | 14 ++------- .../storage/s3/S3ErrorMetricsTest.java | 0 .../storage/s3/S3StorageMetricsTest.java | 0 .../storage/s3/S3StorageTest.java | 0 .../storage/s3/S3TestContainer.java | 0 .../resources/log4j.properties | 0 .../storage/s3/MetricCollector.java | 0 .../storage/s3/S3ClientBuilder.java | 0 .../storage/s3/S3MultiPartOutputStream.java | 0 .../tieredstorage/storage/s3/S3Storage.java | 0 .../storage/s3/S3StorageConfig.java | 0 .../storage/s3/S3ClientBuilderTest.java | 0 .../s3/S3MultiPartOutputStreamTest.java | 0 .../storage/s3/S3StorageConfigTest.java | 0 .../s3/src/test/resources/log4j.properties | 0 54 files changed, 78 insertions(+), 52 deletions(-) rename storage/{ => plugins}/azure/build.gradle (74%) rename storage/{ => plugins}/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageAccountKeyTest.java (100%) rename storage/{ => plugins}/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConnectionStringTest.java (100%) rename storage/{ => plugins}/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageMetricsTest.java (100%) rename storage/{ => plugins}/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageSasTokenTest.java (100%) rename storage/{ => plugins}/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageTest.java (100%) rename storage/{ => plugins}/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzuriteBlobStorageUtils.java (100%) rename storage/{ => plugins}/azure/src/integration-test/resources/log4j.properties (100%) rename storage/{ => plugins}/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorage.java (100%) rename storage/{ => plugins}/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConfig.java (100%) rename storage/{ => plugins}/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/MetricCollector.java (100%) rename storage/{ => plugins}/azure/src/test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConfigTest.java (100%) rename storage/{ => plugins}/azure/src/test/java/io/aiven/kafka/tieredstorage/storage/azure/MetricCollectorTest.java (100%) rename storage/{ => plugins}/azure/src/test/resources/log4j.properties (100%) create mode 100644 storage/plugins/build.gradle rename storage/{ => plugins}/filesystem/build.gradle (86%) rename storage/{ => plugins}/filesystem/src/main/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorage.java (100%) rename storage/{ => plugins}/filesystem/src/main/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageConfig.java (100%) rename storage/{ => plugins}/filesystem/src/test/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageConfigTest.java (100%) rename storage/{ => plugins}/filesystem/src/test/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageTest.java (100%) rename storage/{ => plugins}/filesystem/src/test/resources/log4j.properties (100%) rename storage/{ => plugins}/gcs/build.gradle (65%) rename storage/{ => plugins}/gcs/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageMetricsTest.java (100%) rename storage/{ => plugins}/gcs/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageTest.java (100%) rename storage/{ => plugins}/gcs/src/integration-test/resources/log4j.properties (100%) rename storage/{ => plugins}/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/CredentialsBuilder.java (100%) rename storage/{ => plugins}/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorage.java (100%) rename storage/{ => plugins}/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageConfig.java (100%) rename storage/{ => plugins}/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/MetricCollector.java (100%) rename storage/{ => plugins}/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/CredentialsBuilderTest.java (100%) rename storage/{ => plugins}/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageConfigTest.java (100%) rename storage/{ => plugins}/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/MetricCollectorRegexTest.java (100%) rename storage/{ => plugins}/gcs/src/test/resources/log4j.properties (100%) rename storage/{ => plugins}/gcs/src/test/resources/test_gcs_credentials.json (100%) rename storage/{ => plugins}/s3/build.gradle (64%) rename storage/{ => plugins}/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3ErrorMetricsTest.java (100%) rename storage/{ => plugins}/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageMetricsTest.java (100%) rename storage/{ => plugins}/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageTest.java (100%) rename storage/{ => plugins}/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3TestContainer.java (100%) rename storage/{ => plugins}/s3/src/integration-test/resources/log4j.properties (100%) rename storage/{ => plugins}/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/MetricCollector.java (100%) rename storage/{ => plugins}/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3ClientBuilder.java (100%) rename storage/{ => plugins}/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStream.java (100%) rename storage/{ => plugins}/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3Storage.java (100%) rename storage/{ => plugins}/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageConfig.java (100%) rename storage/{ => plugins}/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3ClientBuilderTest.java (100%) rename storage/{ => plugins}/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStreamTest.java (100%) rename storage/{ => plugins}/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageConfigTest.java (100%) rename storage/{ => plugins}/s3/src/test/resources/log4j.properties (100%) diff --git a/Makefile b/Makefile index 3dcce492a..1a80c22ce 100644 --- a/Makefile +++ b/Makefile @@ -34,13 +34,13 @@ build/distributions/tiered-storage-for-apache-kafka-$(VERSION).tgz: ./gradlew build distTar -x test -x integrationTest -x e2e:test storage/s3/build/distributions/s3-$(VERSION).tgz: - ./gradlew build :storage:s3:distTar -x test -x integrationTest -x e2e:test + ./gradlew build :storage:plugins:s3:distTar -x test -x integrationTest -x e2e:test storage/gcs/build/distributions/gcs-$(VERSION).tgz: - ./gradlew build :storage:gcs:distTar -x test -x integrationTest -x e2e:test + ./gradlew build :storage:plugins:gcs:distTar -x test -x integrationTest -x e2e:test storage/gcs/build/distributions/azure-$(VERSION).tgz: - ./gradlew build :storage:azure:distTar -x test -x integrationTest -x e2e:test + ./gradlew build :storage:plugins:azure:distTar -x test -x integrationTest -x e2e:test test: build ./gradlew test -x e2e:test diff --git a/build.gradle b/build.gradle index 11e3dbf4c..351f2496c 100644 --- a/build.gradle +++ b/build.gradle @@ -74,6 +74,11 @@ subprojects { withJavadocJar() withSourcesJar() } + configurations.runtimeClasspath { + resolutionStrategy { + failOnVersionConflict() + } + } checkstyle { toolVersion = "10.12.0" @@ -123,29 +128,32 @@ subprojects { azureSdkVersion = "1.2.21" - testcontainersVersion = "1.19.4" + testcontainersVersion = "1.19.7" testcontainersFakeGcsServerVersion = "0.2.0" } dependencies { compileOnly "org.apache.kafka:kafka-clients:$kafkaVersion" - compileOnly "org.apache.kafka:kafka-storage-api:$kafkaVersion" + compileOnly("org.apache.kafka:kafka-storage-api:$kafkaVersion") + implementation enforcedPlatform("com.fasterxml.jackson:jackson-bom:$jacksonVersion") compileOnly "org.slf4j:slf4j-api:$slf4jVersion" testImplementation "org.apache.kafka:kafka-clients:$kafkaVersion" - testImplementation "org.apache.kafka:kafka-storage-api:$kafkaVersion" + testImplementation("org.apache.kafka:kafka-storage-api:$kafkaVersion") - testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion" - testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion" - testImplementation 'org.junit.platform:junit-platform-launcher:$junitPlatformVersion' - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion" + testImplementation(platform("org.junit:junit-bom:$junitVersion")) + testImplementation "org.junit.jupiter:junit-jupiter-api" + testImplementation "org.junit.jupiter:junit-jupiter-params" + testImplementation "org.junit.platform:junit-platform-launcher" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" testImplementation "org.assertj:assertj-core:$assertJVersion" - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" + testImplementation(platform("org.mockito:mockito-bom:$mockitoVersion")) + testImplementation "org.mockito:mockito-core" + testImplementation "org.mockito:mockito-junit-jupiter" testImplementation "org.awaitility:awaitility:$awaitilityVersion" @@ -241,8 +249,8 @@ distributions { from(project(":core").configurations.runtimeClasspath) from(project(":storage:core").jar) from(project(":storage:core").configurations.runtimeClasspath) - from(project(":storage:filesystem").jar) - from(project(":storage:filesystem").configurations.runtimeClasspath) + from(project(":storage:plugins:filesystem").jar) + from(project(":storage:plugins:filesystem").configurations.runtimeClasspath) } } } diff --git a/core/build.gradle b/core/build.gradle index 59ce02d28..043e93ac0 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -36,8 +36,8 @@ dependencies { implementation "org.bouncycastle:bcprov-jdk18on:$bouncyCastleVersion" - implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion" - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion" + implementation "com.fasterxml.jackson.core:jackson-databind" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8" implementation "com.github.luben:zstd-jni:$zstdVersion" @@ -47,7 +47,7 @@ dependencies { implementation project(':commons') testImplementation(testFixtures(project(":storage:core"))) - testImplementation(project(":storage:filesystem")) + testImplementation(project(":storage:plugins:filesystem")) testImplementation "com.github.luben:zstd-jni:$zstdVersion" integrationTestImplementation sourceSets.test.output diff --git a/docker/Dockerfile b/docker/Dockerfile index 3474a1842..00a14cb02 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -33,17 +33,17 @@ RUN cd /tiered-storage-for-apache-kafka/core \ && tar -xf tiered-storage-for-apache-kafka-${_VERSION}.tgz --strip-components=1 \ && rm tiered-storage-for-apache-kafka-${_VERSION}.tgz -COPY storage/s3/build/distributions/s3-${_VERSION}.tgz /tiered-storage-for-apache-kafka/s3 +COPY storage/plugins/s3/build/distributions/s3-${_VERSION}.tgz /tiered-storage-for-apache-kafka/s3 RUN cd /tiered-storage-for-apache-kafka/s3 \ && tar -xf s3-${_VERSION}.tgz --strip-components=1 \ && rm s3-${_VERSION}.tgz -COPY storage/gcs/build/distributions/gcs-${_VERSION}.tgz /tiered-storage-for-apache-kafka/gcs +COPY storage/plugins/gcs/build/distributions/gcs-${_VERSION}.tgz /tiered-storage-for-apache-kafka/gcs RUN cd /tiered-storage-for-apache-kafka/gcs \ && tar -xf gcs-${_VERSION}.tgz --strip-components=1 \ && rm gcs-${_VERSION}.tgz -COPY storage/azure/build/distributions/azure-${_VERSION}.tgz /tiered-storage-for-apache-kafka/azure +COPY storage/plugins/azure/build/distributions/azure-${_VERSION}.tgz /tiered-storage-for-apache-kafka/azure RUN cd /tiered-storage-for-apache-kafka/azure \ && tar -xf azure-${_VERSION}.tgz --strip-components=1 \ && rm azure-${_VERSION}.tgz diff --git a/settings.gradle b/settings.gradle index 1d6840abc..07ccaa0aa 100644 --- a/settings.gradle +++ b/settings.gradle @@ -18,9 +18,10 @@ rootProject.name = 'tiered-storage-for-apache-kafka' include 'core' include 'storage' include 'storage:core' -include 'storage:filesystem' -include 'storage:azure' -include 'storage:gcs' -include 'storage:s3' +include 'storage:plugins' +include 'storage:plugins:filesystem' +include 'storage:plugins:azure' +include 'storage:plugins:gcs' +include 'storage:plugins:s3' include 'e2e' include 'commons' diff --git a/storage/azure/build.gradle b/storage/plugins/azure/build.gradle similarity index 74% rename from storage/azure/build.gradle rename to storage/plugins/azure/build.gradle index 0d5b46f88..99831c5d8 100644 --- a/storage/azure/build.gradle +++ b/storage/plugins/azure/build.gradle @@ -17,19 +17,17 @@ archivesBaseName = "storage-azure" dependencies { - implementation project(":storage:core") - implementation platform("com.azure:azure-sdk-bom:$azureSdkVersion") - implementation ("com.azure:azure-identity") { + implementation("com.azure:azure-identity") { exclude group: "org.slf4j" + exclude group: "net.java.dev.jna" + exclude group: "com.microsoft.azure", module: "msal4j" } - implementation ("com.azure:azure-storage-blob") { + implementation("com.azure:azure-storage-blob") { exclude group: "org.slf4j" } implementation project(":commons") - testImplementation(testFixtures(project(":storage:core"))) - - testImplementation "org.testcontainers:junit-jupiter:$testcontainersVersion" + testImplementation("org.testcontainers:junit-jupiter:$testcontainersVersion") } diff --git a/storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageAccountKeyTest.java b/storage/plugins/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageAccountKeyTest.java similarity index 100% rename from storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageAccountKeyTest.java rename to storage/plugins/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageAccountKeyTest.java diff --git a/storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConnectionStringTest.java b/storage/plugins/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConnectionStringTest.java similarity index 100% rename from storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConnectionStringTest.java rename to storage/plugins/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConnectionStringTest.java diff --git a/storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageMetricsTest.java b/storage/plugins/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageMetricsTest.java similarity index 100% rename from storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageMetricsTest.java rename to storage/plugins/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageMetricsTest.java diff --git a/storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageSasTokenTest.java b/storage/plugins/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageSasTokenTest.java similarity index 100% rename from storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageSasTokenTest.java rename to storage/plugins/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageSasTokenTest.java diff --git a/storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageTest.java b/storage/plugins/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageTest.java similarity index 100% rename from storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageTest.java rename to storage/plugins/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageTest.java diff --git a/storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzuriteBlobStorageUtils.java b/storage/plugins/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzuriteBlobStorageUtils.java similarity index 100% rename from storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzuriteBlobStorageUtils.java rename to storage/plugins/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzuriteBlobStorageUtils.java diff --git a/storage/azure/src/integration-test/resources/log4j.properties b/storage/plugins/azure/src/integration-test/resources/log4j.properties similarity index 100% rename from storage/azure/src/integration-test/resources/log4j.properties rename to storage/plugins/azure/src/integration-test/resources/log4j.properties diff --git a/storage/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorage.java b/storage/plugins/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorage.java similarity index 100% rename from storage/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorage.java rename to storage/plugins/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorage.java diff --git a/storage/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConfig.java b/storage/plugins/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConfig.java similarity index 100% rename from storage/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConfig.java rename to storage/plugins/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConfig.java diff --git a/storage/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/MetricCollector.java b/storage/plugins/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/MetricCollector.java similarity index 100% rename from storage/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/MetricCollector.java rename to storage/plugins/azure/src/main/java/io/aiven/kafka/tieredstorage/storage/azure/MetricCollector.java diff --git a/storage/azure/src/test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConfigTest.java b/storage/plugins/azure/src/test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConfigTest.java similarity index 100% rename from storage/azure/src/test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConfigTest.java rename to storage/plugins/azure/src/test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageConfigTest.java diff --git a/storage/azure/src/test/java/io/aiven/kafka/tieredstorage/storage/azure/MetricCollectorTest.java b/storage/plugins/azure/src/test/java/io/aiven/kafka/tieredstorage/storage/azure/MetricCollectorTest.java similarity index 100% rename from storage/azure/src/test/java/io/aiven/kafka/tieredstorage/storage/azure/MetricCollectorTest.java rename to storage/plugins/azure/src/test/java/io/aiven/kafka/tieredstorage/storage/azure/MetricCollectorTest.java diff --git a/storage/azure/src/test/resources/log4j.properties b/storage/plugins/azure/src/test/resources/log4j.properties similarity index 100% rename from storage/azure/src/test/resources/log4j.properties rename to storage/plugins/azure/src/test/resources/log4j.properties diff --git a/storage/plugins/build.gradle b/storage/plugins/build.gradle new file mode 100644 index 000000000..b6d60d26e --- /dev/null +++ b/storage/plugins/build.gradle @@ -0,0 +1,31 @@ +/* + * Copyright 2024 Aiven Oy + * + * 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. + */ + +subprojects { + configurations { + providedRuntime + implementation.extendsFrom(providedRuntime) + } + + dependencies { + implementation project(":storage:core") + + providedRuntime project(":core") + + testImplementation(testFixtures(project(":storage:core"))) + } +} + diff --git a/storage/filesystem/build.gradle b/storage/plugins/filesystem/build.gradle similarity index 86% rename from storage/filesystem/build.gradle rename to storage/plugins/filesystem/build.gradle index 316e40545..58e93a507 100644 --- a/storage/filesystem/build.gradle +++ b/storage/plugins/filesystem/build.gradle @@ -17,9 +17,5 @@ archivesBaseName = "storage-filesystem" dependencies { - implementation project(":storage:core") - implementation "commons-io:commons-io:$apacheCommonsIOVersion" - - testImplementation(testFixtures(project(":storage:core"))) } diff --git a/storage/filesystem/src/main/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorage.java b/storage/plugins/filesystem/src/main/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorage.java similarity index 100% rename from storage/filesystem/src/main/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorage.java rename to storage/plugins/filesystem/src/main/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorage.java diff --git a/storage/filesystem/src/main/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageConfig.java b/storage/plugins/filesystem/src/main/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageConfig.java similarity index 100% rename from storage/filesystem/src/main/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageConfig.java rename to storage/plugins/filesystem/src/main/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageConfig.java diff --git a/storage/filesystem/src/test/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageConfigTest.java b/storage/plugins/filesystem/src/test/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageConfigTest.java similarity index 100% rename from storage/filesystem/src/test/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageConfigTest.java rename to storage/plugins/filesystem/src/test/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageConfigTest.java diff --git a/storage/filesystem/src/test/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageTest.java b/storage/plugins/filesystem/src/test/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageTest.java similarity index 100% rename from storage/filesystem/src/test/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageTest.java rename to storage/plugins/filesystem/src/test/java/io/aiven/kafka/tieredstorage/storage/filesystem/FileSystemStorageTest.java diff --git a/storage/filesystem/src/test/resources/log4j.properties b/storage/plugins/filesystem/src/test/resources/log4j.properties similarity index 100% rename from storage/filesystem/src/test/resources/log4j.properties rename to storage/plugins/filesystem/src/test/resources/log4j.properties diff --git a/storage/gcs/build.gradle b/storage/plugins/gcs/build.gradle similarity index 65% rename from storage/gcs/build.gradle rename to storage/plugins/gcs/build.gradle index 7bbc051ca..1ecffa181 100644 --- a/storage/gcs/build.gradle +++ b/storage/plugins/gcs/build.gradle @@ -17,14 +17,14 @@ archivesBaseName = "storage-gcs" dependencies { - implementation project(":storage:core") + implementation("com.google.cloud:google-cloud-storage:$gcpSdkVersion") { + exclude group: "com.google.errorprone" + exclude group: "org.checkerframework" + } - implementation "com.google.cloud:google-cloud-storage:$gcpSdkVersion" implementation project(":commons") - testImplementation(testFixtures(project(":storage:core"))) + testImplementation("org.testcontainers:junit-jupiter:$testcontainersVersion") - testImplementation "org.testcontainers:junit-jupiter:$testcontainersVersion" - - testImplementation "io.aiven:testcontainers-fake-gcs-server:$testcontainersFakeGcsServerVersion" + testImplementation("io.aiven:testcontainers-fake-gcs-server:$testcontainersFakeGcsServerVersion") } diff --git a/storage/gcs/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageMetricsTest.java b/storage/plugins/gcs/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageMetricsTest.java similarity index 100% rename from storage/gcs/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageMetricsTest.java rename to storage/plugins/gcs/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageMetricsTest.java diff --git a/storage/gcs/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageTest.java b/storage/plugins/gcs/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageTest.java similarity index 100% rename from storage/gcs/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageTest.java rename to storage/plugins/gcs/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageTest.java diff --git a/storage/gcs/src/integration-test/resources/log4j.properties b/storage/plugins/gcs/src/integration-test/resources/log4j.properties similarity index 100% rename from storage/gcs/src/integration-test/resources/log4j.properties rename to storage/plugins/gcs/src/integration-test/resources/log4j.properties diff --git a/storage/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/CredentialsBuilder.java b/storage/plugins/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/CredentialsBuilder.java similarity index 100% rename from storage/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/CredentialsBuilder.java rename to storage/plugins/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/CredentialsBuilder.java diff --git a/storage/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorage.java b/storage/plugins/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorage.java similarity index 100% rename from storage/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorage.java rename to storage/plugins/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorage.java diff --git a/storage/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageConfig.java b/storage/plugins/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageConfig.java similarity index 100% rename from storage/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageConfig.java rename to storage/plugins/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageConfig.java diff --git a/storage/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/MetricCollector.java b/storage/plugins/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/MetricCollector.java similarity index 100% rename from storage/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/MetricCollector.java rename to storage/plugins/gcs/src/main/java/io/aiven/kafka/tieredstorage/storage/gcs/MetricCollector.java diff --git a/storage/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/CredentialsBuilderTest.java b/storage/plugins/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/CredentialsBuilderTest.java similarity index 100% rename from storage/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/CredentialsBuilderTest.java rename to storage/plugins/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/CredentialsBuilderTest.java diff --git a/storage/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageConfigTest.java b/storage/plugins/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageConfigTest.java similarity index 100% rename from storage/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageConfigTest.java rename to storage/plugins/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/GcsStorageConfigTest.java diff --git a/storage/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/MetricCollectorRegexTest.java b/storage/plugins/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/MetricCollectorRegexTest.java similarity index 100% rename from storage/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/MetricCollectorRegexTest.java rename to storage/plugins/gcs/src/test/java/io/aiven/kafka/tieredstorage/storage/gcs/MetricCollectorRegexTest.java diff --git a/storage/gcs/src/test/resources/log4j.properties b/storage/plugins/gcs/src/test/resources/log4j.properties similarity index 100% rename from storage/gcs/src/test/resources/log4j.properties rename to storage/plugins/gcs/src/test/resources/log4j.properties diff --git a/storage/gcs/src/test/resources/test_gcs_credentials.json b/storage/plugins/gcs/src/test/resources/test_gcs_credentials.json similarity index 100% rename from storage/gcs/src/test/resources/test_gcs_credentials.json rename to storage/plugins/gcs/src/test/resources/test_gcs_credentials.json diff --git a/storage/s3/build.gradle b/storage/plugins/s3/build.gradle similarity index 64% rename from storage/s3/build.gradle rename to storage/plugins/s3/build.gradle index 59c5ceaa8..8279262ba 100644 --- a/storage/s3/build.gradle +++ b/storage/plugins/s3/build.gradle @@ -21,20 +21,12 @@ ext { } dependencies { - implementation project(":storage:core") - - // Take out jackson libraries out to avoid collision with core jackson dependencies - implementation ("software.amazon.awssdk:s3:$awsSdkVersion") { - exclude group: "com.fasterxml.jackson.core" - exclude group: "com.fasterxml.jackson.dataformat" + implementation("software.amazon.awssdk:s3:$awsSdkVersion") { exclude group: "org.slf4j" + exclude group: "commons-codec" } // replacing with version used by core - implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion" - implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:$jacksonVersion" - implementation project(':commons') - - testImplementation(testFixtures(project(":storage:core"))) + implementation project(":commons") testImplementation "org.testcontainers:junit-jupiter:$testcontainersVersion" testImplementation "org.testcontainers:localstack:$testcontainersVersion" diff --git a/storage/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3ErrorMetricsTest.java b/storage/plugins/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3ErrorMetricsTest.java similarity index 100% rename from storage/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3ErrorMetricsTest.java rename to storage/plugins/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3ErrorMetricsTest.java diff --git a/storage/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageMetricsTest.java b/storage/plugins/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageMetricsTest.java similarity index 100% rename from storage/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageMetricsTest.java rename to storage/plugins/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageMetricsTest.java diff --git a/storage/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageTest.java b/storage/plugins/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageTest.java similarity index 100% rename from storage/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageTest.java rename to storage/plugins/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageTest.java diff --git a/storage/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3TestContainer.java b/storage/plugins/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3TestContainer.java similarity index 100% rename from storage/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3TestContainer.java rename to storage/plugins/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3TestContainer.java diff --git a/storage/s3/src/integration-test/resources/log4j.properties b/storage/plugins/s3/src/integration-test/resources/log4j.properties similarity index 100% rename from storage/s3/src/integration-test/resources/log4j.properties rename to storage/plugins/s3/src/integration-test/resources/log4j.properties diff --git a/storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/MetricCollector.java b/storage/plugins/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/MetricCollector.java similarity index 100% rename from storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/MetricCollector.java rename to storage/plugins/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/MetricCollector.java diff --git a/storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3ClientBuilder.java b/storage/plugins/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3ClientBuilder.java similarity index 100% rename from storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3ClientBuilder.java rename to storage/plugins/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3ClientBuilder.java diff --git a/storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStream.java b/storage/plugins/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStream.java similarity index 100% rename from storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStream.java rename to storage/plugins/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStream.java diff --git a/storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3Storage.java b/storage/plugins/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3Storage.java similarity index 100% rename from storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3Storage.java rename to storage/plugins/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3Storage.java diff --git a/storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageConfig.java b/storage/plugins/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageConfig.java similarity index 100% rename from storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageConfig.java rename to storage/plugins/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageConfig.java diff --git a/storage/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3ClientBuilderTest.java b/storage/plugins/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3ClientBuilderTest.java similarity index 100% rename from storage/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3ClientBuilderTest.java rename to storage/plugins/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3ClientBuilderTest.java diff --git a/storage/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStreamTest.java b/storage/plugins/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStreamTest.java similarity index 100% rename from storage/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStreamTest.java rename to storage/plugins/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStreamTest.java diff --git a/storage/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageConfigTest.java b/storage/plugins/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageConfigTest.java similarity index 100% rename from storage/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageConfigTest.java rename to storage/plugins/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageConfigTest.java diff --git a/storage/s3/src/test/resources/log4j.properties b/storage/plugins/s3/src/test/resources/log4j.properties similarity index 100% rename from storage/s3/src/test/resources/log4j.properties rename to storage/plugins/s3/src/test/resources/log4j.properties