diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4bee199dc5b..86f32f7b7c1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -55,6 +55,7 @@ systemlambda = "1.2.1" testcontainers = "1.17.5" vertx = "3.9.13" wiremock = "2.33.2" +javax-validation-api = "2.0.1.Final" # # Versions which start with managed- are managed by Micronaut in the sense @@ -262,5 +263,7 @@ httpcomponents-mime = { module = "org.apache.httpcomponents:httpmime", version.r wiremock = { module = "com.github.tomakehurst:wiremock-jre8", version.ref = "wiremock" } +javax-validation-api = { module = "javax.validation:validation-api", version.ref = "javax-validation-api" } + [bundles] asm = ["asm", "asm-commons"] diff --git a/http-server-tck/build.gradle.kts b/http-server-tck/build.gradle.kts index 7b67e1976d0..cdd58b0d0b2 100644 --- a/http-server-tck/build.gradle.kts +++ b/http-server-tck/build.gradle.kts @@ -3,20 +3,11 @@ plugins { } dependencies { annotationProcessor(projects.injectJava) - - annotationProcessor(platform(libs.test.boms.micronaut.validation)) - annotationProcessor(libs.micronaut.validation.processor) { - exclude(group = "io.micronaut") - } annotationProcessor(projects.httpValidation) - - implementation(platform(libs.test.boms.micronaut.validation)) - implementation(libs.micronaut.validation) { - exclude(group = "io.micronaut") - } implementation(projects.runtime) implementation(projects.jacksonDatabind) implementation(projects.inject) + implementation(libs.javax.validation.api) api(projects.httpTck) api(projects.httpServer) diff --git a/http-server-tck/src/main/java/io/micronaut/http/server/tck/tests/ErrorHandlerTest.java b/http-server-tck/src/main/java/io/micronaut/http/server/tck/tests/ErrorHandlerTest.java index 935620a030a..5955677e69b 100644 --- a/http-server-tck/src/main/java/io/micronaut/http/server/tck/tests/ErrorHandlerTest.java +++ b/http-server-tck/src/main/java/io/micronaut/http/server/tck/tests/ErrorHandlerTest.java @@ -41,6 +41,7 @@ import io.micronaut.http.tck.ServerUnderTest; import io.micronaut.http.tck.ServerUnderTestProviderUtils; import jakarta.inject.Singleton; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import jakarta.validation.Valid; @@ -191,6 +192,7 @@ void corsHeadersArePresentAfterExceptions() throws IOException { .build())); } + @Disabled("/to avoid a circular dependency to validation. https://github.com/micronaut-projects/micronaut-validation/issues/63") @Test void messageValidationErrorsReturn400() throws IOException { asserts(SPEC_NAME, diff --git a/http-tck/build.gradle.kts b/http-tck/build.gradle.kts index 3d93011d827..a5b087d4978 100644 --- a/http-tck/build.gradle.kts +++ b/http-tck/build.gradle.kts @@ -5,16 +5,7 @@ plugins { } dependencies { annotationProcessor(projects.injectJava) - annotationProcessor(platform(libs.test.boms.micronaut.validation)) - annotationProcessor(libs.micronaut.validation.processor) { - exclude(group = "io.micronaut") - } annotationProcessor(projects.httpValidation) - - implementation(platform(libs.test.boms.micronaut.validation)) - implementation(libs.micronaut.validation) { - exclude(group = "io.micronaut") - } implementation(projects.runtime) implementation(projects.jacksonDatabind) implementation(projects.inject) diff --git a/test-suite-http-server-tck-jdk/build.gradle.kts b/test-suite-http-server-tck-jdk/build.gradle.kts index 2f7d7926dd4..f56170acf33 100644 --- a/test-suite-http-server-tck-jdk/build.gradle.kts +++ b/test-suite-http-server-tck-jdk/build.gradle.kts @@ -6,6 +6,10 @@ dependencies { testImplementation(projects.httpClientJdk) testImplementation(projects.httpServerTck) testImplementation(libs.junit.platform.engine) + testImplementation(platform(libs.test.boms.micronaut.validation)) + testImplementation(libs.micronaut.validation) { + exclude(mapOf("group" to "io.micronaut")) + } } tasks.withType(Test::class) { diff --git a/test-suite-http-server-tck-netty/build.gradle b/test-suite-http-server-tck-netty/build.gradle index 694b268670e..4232a496a39 100644 --- a/test-suite-http-server-tck-netty/build.gradle +++ b/test-suite-http-server-tck-netty/build.gradle @@ -20,13 +20,13 @@ micronautBuild { } dependencies { - implementation(projects.httpServerTck) + testImplementation(projects.httpServerTck) testImplementation(projects.httpServerNetty) testImplementation(projects.httpClient) testImplementation(libs.junit.platform.engine) testImplementation(libs.managed.logback.classic) - implementation platform(libs.test.boms.micronaut.validation) - implementation(libs.micronaut.validation) { + testImplementation platform(libs.test.boms.micronaut.validation) + testImplementation(libs.micronaut.validation) { exclude group: 'io.micronaut' }