diff --git a/authorizations/authorization-ranger/build.gradle.kts b/authorizations/authorization-ranger/build.gradle.kts index a8e46e079b0..b9a4988658e 100644 --- a/authorizations/authorization-ranger/build.gradle.kts +++ b/authorizations/authorization-ranger/build.gradle.kts @@ -68,7 +68,6 @@ dependencies { testImplementation(project(":catalogs:catalog-common")) testImplementation(project(":integration-test-common", "testArtifacts")) testImplementation(libs.mockito.core) - testImplementation(libs.h2db) testImplementation(libs.mysql.driver) testImplementation(libs.postgresql.driver) testImplementation("org.apache.spark:spark-hive_$scalaVersion:$sparkVersion") diff --git a/catalogs/catalog-hadoop/build.gradle.kts b/catalogs/catalog-hadoop/build.gradle.kts index 1ea30e10687..0a7059cf7f1 100644 --- a/catalogs/catalog-hadoop/build.gradle.kts +++ b/catalogs/catalog-hadoop/build.gradle.kts @@ -68,10 +68,9 @@ dependencies { implementation(libs.slf4j.api) testImplementation(project(":integration-test-common", "testArtifacts")) - + testImplementation(libs.bundles.metrics) testImplementation(libs.minikdc) testImplementation(libs.hadoop3.minicluster) - testImplementation(libs.bundles.log4j) testImplementation(libs.mockito.core) testImplementation(libs.mockito.inline) diff --git a/core/src/main/java/org/apache/gravitino/storage/relational/database/H2Database.java b/core/src/main/java/org/apache/gravitino/storage/relational/database/H2Database.java index 4214a9baeda..8cf205d41f2 100644 --- a/core/src/main/java/org/apache/gravitino/storage/relational/database/H2Database.java +++ b/core/src/main/java/org/apache/gravitino/storage/relational/database/H2Database.java @@ -54,6 +54,12 @@ public String startH2Database(Config config) { String connectionUrl = constructH2URI(originalJDBCUrl, storagePath); + try { + Class.forName("org.h2.Driver"); + } catch (ClassNotFoundException e) { + throw new RuntimeException("Failed to load H2 driver.", e); + } + try (Connection connection = DriverManager.getConnection(connectionUrl, username, password); Statement statement = connection.createStatement()) { String sqlContent = diff --git a/integration-test-common/build.gradle.kts b/integration-test-common/build.gradle.kts index d09314a957b..e4c3007417a 100644 --- a/integration-test-common/build.gradle.kts +++ b/integration-test-common/build.gradle.kts @@ -64,6 +64,7 @@ dependencies { exclude("com.amazonaws", "aws-java-sdk-bundle") } testImplementation(libs.apiguardian.api) + testImplementation(libs.bundles.metrics) testImplementation(libs.junit.jupiter.params) testImplementation(libs.junit.jupiter.api) testImplementation(libs.junit.jupiter.engine) diff --git a/spark-connector/v3.3/spark/build.gradle.kts b/spark-connector/v3.3/spark/build.gradle.kts index 1d934459939..89eb240fea4 100644 --- a/spark-connector/v3.3/spark/build.gradle.kts +++ b/spark-connector/v3.3/spark/build.gradle.kts @@ -51,6 +51,14 @@ dependencies { exclude("org.apache.logging.log4j") exclude("org.slf4j") } + testImplementation(project(":server")) { + exclude("org.apache.logging.log4j") + exclude("org.slf4j") + } + testImplementation(project(":server-common")) { + exclude("org.apache.logging.log4j") + exclude("org.slf4j") + } testImplementation(project(":spark-connector:spark-common", "testArtifacts")) { exclude("com.fasterxml.jackson") } diff --git a/spark-connector/v3.4/spark/build.gradle.kts b/spark-connector/v3.4/spark/build.gradle.kts index 2494eaaa2fe..355a6006c06 100644 --- a/spark-connector/v3.4/spark/build.gradle.kts +++ b/spark-connector/v3.4/spark/build.gradle.kts @@ -52,6 +52,14 @@ dependencies { exclude("org.apache.logging.log4j") exclude("org.slf4j") } + testImplementation(project(":server")) { + exclude("org.apache.logging.log4j") + exclude("org.slf4j") + } + testImplementation(project(":server-common")) { + exclude("org.apache.logging.log4j") + exclude("org.slf4j") + } testImplementation(project(":spark-connector:spark-common", "testArtifacts")) { exclude("com.fasterxml.jackson") } diff --git a/spark-connector/v3.5/spark/build.gradle.kts b/spark-connector/v3.5/spark/build.gradle.kts index a8f8a44d02e..3e711a83b6f 100644 --- a/spark-connector/v3.5/spark/build.gradle.kts +++ b/spark-connector/v3.5/spark/build.gradle.kts @@ -53,11 +53,17 @@ dependencies { exclude("org.apache.logging.log4j") exclude("org.slf4j") } - testImplementation(project(":spark-connector:spark-common", "testArtifacts")) { - exclude("com.fasterxml.jackson") + testImplementation(project(":server")) { + exclude("org.apache.logging.log4j") + exclude("org.slf4j") + } + testImplementation(project(":server-common")) { exclude("org.apache.logging.log4j") exclude("org.slf4j") } + testImplementation(project(":spark-connector:spark-common", "testArtifacts")) { + exclude("com.fasterxml.jackson") + } testImplementation(libs.hive2.common) { exclude("com.sun.jersey")