Skip to content

Commit

Permalink
fix: don’t leakage Micronaut Validation (#1267)
Browse files Browse the repository at this point in the history
* fix: don’t leakage Micronaut Validation

* test with hibernate validator

* jakarta-valdiation-api as compileOnly
  • Loading branch information
sdelamo authored Feb 13, 2024
1 parent dc6181b commit 2dcf574
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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" }
Expand Down
4 changes: 3 additions & 1 deletion hibernate-jpa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down
1 change: 1 addition & 0 deletions hibernate-reactive/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ micronautBuild {
importMicronautCatalog("micronaut-spring")
importMicronautCatalog("micronaut-test-resources")
importMicronautCatalog("micronaut-validation")
importMicronautCatalog("micronaut-hibernate-validator")
}

rootProject.name = 'sql-parent'
Expand Down

0 comments on commit 2dcf574

Please sign in to comment.