From 2dcf5740f19fe39d7fe72c896104fd1fbd3a8953 Mon Sep 17 00:00:00 2001 From: Sergio del Amo Date: Tue, 13 Feb 2024 06:41:57 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20don=E2=80=99t=20leakage=20Micronaut=20Va?= =?UTF-8?q?lidation=20(#1267)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: don’t leakage Micronaut Validation * test with hibernate validator * jakarta-valdiation-api as compileOnly --- gradle/libs.versions.toml | 5 +---- hibernate-jpa/build.gradle | 4 +++- hibernate-reactive/build.gradle | 1 + settings.gradle | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e0ea7f046..b3090ee1d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -68,7 +68,7 @@ sonar-gradle-plugin = "4.4.1.3373" micronaut-core = { module = 'io.micronaut:micronaut-core-bom', version.ref = 'micronaut' } # Platform catalogs - +micronaut-hibernate-validator = { module = "io.micronaut.beanvalidation:micronaut-hibernate-validator-bom", version.ref = "micronaut-hibernate-validator" } micronaut-cache = { module = "io.micronaut.cache:micronaut-cache-bom", version.ref = "micronaut-cache" } micronaut-data = { module = "io.micronaut.data:micronaut-data-bom", version.ref = "micronaut-data" } micronaut-micrometer = { module = "io.micronaut.micrometer:micronaut-micrometer-bom", version.ref = "micronaut-micrometer" } @@ -80,9 +80,6 @@ micronaut-test = { module = "io.micronaut.test:micronaut-test-bom", version.ref micronaut-test-resources = { module = "io.micronaut.testresources:micronaut-test-resources-bom", version.ref = "micronaut-test-resources" } micronaut-validation = { module = "io.micronaut.validation:micronaut-validation-bom", version.ref = "micronaut-validation" } -# Switch to BOM and catalog import when there's a bom -micronaut-hibernate-validator = { module = "io.micronaut.beanvalidation:micronaut-hibernate-validator", version.ref = "micronaut-hibernate-validator" } - # Vertx managed-vertx-sql-client = { module = "io.vertx:vertx-sql-client", version.ref = "managed-vertx" } diff --git a/hibernate-jpa/build.gradle b/hibernate-jpa/build.gradle index 4fc1f31fd..92217667c 100644 --- a/hibernate-jpa/build.gradle +++ b/hibernate-jpa/build.gradle @@ -7,7 +7,7 @@ dependencies { api(libs.managed.hibernate.core) api(libs.managed.jakarta.transaction.api) - api(mnValidation.micronaut.validation) + compileOnly(mnValidation.validation) // jakarta.validation:jakarta.validation-api compileOnly(mnData.micronaut.data.tx.hibernate) testImplementation(mnData.micronaut.data.tx.hibernate) api(mn.micronaut.aop) @@ -28,6 +28,8 @@ dependencies { testImplementation(mnMicrometer.micronaut.micrometer.core) testImplementation(libs.managed.hibernate.micrometer) + testImplementation(mnHibernateValidator.micronaut.hibernate.validator) + testRuntimeOnly projects.micronautJdbcTomcat testRuntimeOnly(libs.managed.h2) diff --git a/hibernate-reactive/build.gradle b/hibernate-reactive/build.gradle index 1f79ab570..0ea711fa4 100644 --- a/hibernate-reactive/build.gradle +++ b/hibernate-reactive/build.gradle @@ -26,4 +26,5 @@ dependencies { testImplementation(mnTestResources.testcontainers.postgres) testImplementation libs.managed.vertx.pg.client testImplementation(mnData.micronaut.data.tx.hibernate) + testImplementation(mnValidation.micronaut.validation) } diff --git a/settings.gradle b/settings.gradle index c1ebac33e..a5df55767 100644 --- a/settings.gradle +++ b/settings.gradle @@ -23,6 +23,7 @@ micronautBuild { importMicronautCatalog("micronaut-spring") importMicronautCatalog("micronaut-test-resources") importMicronautCatalog("micronaut-validation") + importMicronautCatalog("micronaut-hibernate-validator") } rootProject.name = 'sql-parent'