Create spring-boot-validation module

This commit is contained in:
Stéphane Nicoll 2025-03-19 14:43:09 +01:00 committed by Andy Wilkinson
parent 8ace2c22d7
commit db247c5e02
39 changed files with 91 additions and 59 deletions

View File

@ -84,6 +84,7 @@ include "spring-boot-project:spring-boot-tools:spring-boot-test-support"
include "spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"
include "spring-boot-project:spring-boot-tx"
include "spring-boot-project:spring-boot-undertow"
include "spring-boot-project:spring-boot-validation"
include "spring-boot-system-tests:spring-boot-deployment-tests"
include "spring-boot-system-tests:spring-boot-image-tests"
include "spring-boot-tests:spring-boot-integration-tests:spring-boot-configuration-processor-tests"

View File

@ -29,6 +29,7 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
optional(project(":spring-boot-project:spring-boot-tomcat"))
optional(project(":spring-boot-project:spring-boot-undertow"))
optional(project(":spring-boot-project:spring-boot-validation"))
optional("ch.qos.logback:logback-classic")
optional("org.apache.cassandra:java-driver-core") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"

View File

@ -31,6 +31,7 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
optional(project(":spring-boot-project:spring-boot-tomcat"))
optional(project(":spring-boot-project:spring-boot-undertow"))
optional(project(":spring-boot-project:spring-boot-validation"))
optional("org.apache.cassandra:java-driver-core") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -31,10 +31,10 @@ import org.springframework.boot.actuate.endpoint.annotation.DiscoveredEndpoint;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.test.context.runner.ContextConsumer;
import org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.validation.annotation.Validated;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -39,10 +39,10 @@ import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.web.EndpointServlet;
import org.springframework.boot.actuate.endpoint.web.ExposableServletEndpoint;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.test.context.runner.ContextConsumer;
import org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.validation.annotation.Validated;

View File

@ -51,6 +51,7 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
optional(project(":spring-boot-project:spring-boot-tomcat"))
optional(project(":spring-boot-project:spring-boot-tx"))
optional(project(":spring-boot-project:spring-boot-validation"))
optional("co.elastic.clients:elasticsearch-java") {
exclude group: "commons-logging", module: "commons-logging"
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -24,7 +24,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate;
import org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfiguration;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -39,7 +38,8 @@ import org.springframework.data.couchbase.repository.CouchbaseRepository;
* @author Stephane Nicoll
* @since 1.4.0
*/
@AutoConfiguration(after = { CouchbaseAutoConfiguration.class, ValidationAutoConfiguration.class })
@AutoConfiguration(after = CouchbaseAutoConfiguration.class,
afterName = "org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration")
@ConditionalOnClass({ Bucket.class, CouchbaseRepository.class })
@EnableConfigurationProperties(CouchbaseDataProperties.class)
@Import({ CouchbaseDataConfiguration.class, CouchbaseClientFactoryConfiguration.class,

View File

@ -36,8 +36,6 @@ import org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration
import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProviders;
import org.springframework.boot.autoconfigure.thread.Threading;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.autoconfigure.validation.ValidatorAdapter;
import org.springframework.boot.autoconfigure.web.ConditionalOnEnabledResourceChain;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.autoconfigure.web.WebProperties;
@ -48,6 +46,7 @@ import org.springframework.boot.autoconfigure.web.format.WebConversionService;
import org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties.Format;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.convert.ApplicationConversionService;
import org.springframework.boot.validation.autoconfigure.ValidatorAdapter;
import org.springframework.boot.web.codec.CodecCustomizer;
import org.springframework.boot.web.reactive.filter.OrderedHiddenHttpMethodFilter;
import org.springframework.context.ApplicationContext;
@ -106,8 +105,10 @@ import org.springframework.web.server.session.WebSessionManager;
* @author Weix Sun
* @since 2.0.0
*/
@AutoConfiguration(after = { CodecsAutoConfiguration.class, ReactiveMultipartAutoConfiguration.class,
ValidationAutoConfiguration.class, WebSessionIdResolverAutoConfiguration.class })
@AutoConfiguration(
after = { CodecsAutoConfiguration.class, ReactiveMultipartAutoConfiguration.class,
WebSessionIdResolverAutoConfiguration.class },
afterName = "org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration")
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
@ConditionalOnClass(WebFluxConfigurer.class)
@ConditionalOnMissingBean({ WebFluxConfigurationSupport.class })

View File

@ -44,8 +44,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplicat
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProviders;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.autoconfigure.validation.ValidatorAdapter;
import org.springframework.boot.autoconfigure.web.ConditionalOnEnabledResourceChain;
import org.springframework.boot.autoconfigure.web.WebProperties;
import org.springframework.boot.autoconfigure.web.WebProperties.Resources;
@ -56,6 +54,7 @@ import org.springframework.boot.autoconfigure.web.format.WebConversionService;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties.Format;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.convert.ApplicationConversionService;
import org.springframework.boot.validation.autoconfigure.ValidatorAdapter;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.boot.web.servlet.filter.OrderedFormContentFilter;
import org.springframework.boot.web.servlet.filter.OrderedHiddenHttpMethodFilter;
@ -142,8 +141,8 @@ import org.springframework.web.util.UrlPathHelper;
* @author Scott Frederick
* @since 2.0.0
*/
@AutoConfiguration(after = { DispatcherServletAutoConfiguration.class, TaskExecutionAutoConfiguration.class,
ValidationAutoConfiguration.class })
@AutoConfiguration(after = { DispatcherServletAutoConfiguration.class, TaskExecutionAutoConfiguration.class },
afterName = "org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration")
@ConditionalOnWebApplication(type = Type.SERVLET)
@ConditionalOnClass({ Servlet.class, DispatcherServlet.class, WebMvcConfigurer.class })
@ConditionalOnMissingBean(WebMvcConfigurationSupport.class)
@ -529,7 +528,9 @@ public class WebMvcAutoConfiguration {
@Bean
@Override
public Validator mvcValidator() {
if (!ClassUtils.isPresent("jakarta.validation.Validator", getClass().getClassLoader())) {
if (!ClassUtils.isPresent("jakarta.validation.Validator", getClass().getClassLoader())
|| !ClassUtils.isPresent("org.springframework.boot.validation.autoconfigure.ValidatorAdapter",
getClass().getClassLoader())) {
return super.mvcValidator();
}
return ValidatorAdapter.get(getApplicationContext(), getValidator());

View File

@ -4,8 +4,7 @@ org.springframework.boot.autoconfigure.integration.IntegrationPropertiesEnvironm
# Background Preinitializers
org.springframework.boot.autoconfigure.preinitialize.BackgroundPreinitializer=\
org.springframework.boot.autoconfigure.http.MessageConverterBackgroundPreinitializer,\
org.springframework.boot.autoconfigure.validation.JakartaValidationBackgroundPreinitializer
org.springframework.boot.autoconfigure.http.MessageConverterBackgroundPreinitializer
# Failure Analyzers
org.springframework.boot.diagnostics.FailureAnalyzer=\

View File

@ -101,7 +101,6 @@ org.springframework.boot.autoconfigure.security.oauth2.server.servlet.OAuth2Auth
org.springframework.boot.autoconfigure.sendgrid.SendGridAutoConfiguration
org.springframework.boot.autoconfigure.session.SessionAutoConfiguration
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
org.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration
org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration
org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -25,8 +25,8 @@ import org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfigurati
import org.springframework.boot.autoconfigure.couchbase.CouchbaseProperties;
import org.springframework.boot.autoconfigure.data.couchbase.city.City;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -25,8 +25,8 @@ import org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfigurati
import org.springframework.boot.autoconfigure.couchbase.CouchbaseProperties;
import org.springframework.boot.autoconfigure.data.couchbase.city.City;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

View File

@ -48,8 +48,6 @@ import org.springframework.aop.support.AopUtils;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.aop.AopAutoConfiguration;
import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.autoconfigure.validation.ValidatorAdapter;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration.WebFluxConfig;
import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfigurationTests.OrderedControllerAdviceBeansConfiguration.HighestOrderedControllerAdvice;
@ -58,6 +56,8 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.test.context.runner.ContextConsumer;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
import org.springframework.boot.testsupport.classpath.resources.WithResource;
import org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration;
import org.springframework.boot.validation.autoconfigure.ValidatorAdapter;
import org.springframework.boot.web.codec.CodecCustomizer;
import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext;
import org.springframework.boot.web.reactive.filter.OrderedHiddenHttpMethodFilter;

View File

@ -49,8 +49,6 @@ import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoCon
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.autoconfigure.validation.ValidatorAdapter;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfigurationTests.OrderedControllerAdviceBeansConfiguration.HighestOrderedControllerAdvice;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfigurationTests.OrderedControllerAdviceBeansConfiguration.LowestOrderedControllerAdvice;
@ -59,6 +57,8 @@ import org.springframework.boot.test.context.runner.ContextConsumer;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
import org.springframework.boot.testsupport.classpath.resources.WithResource;
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
import org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration;
import org.springframework.boot.validation.autoconfigure.ValidatorAdapter;
import org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor;
import org.springframework.boot.web.server.servlet.MockServletWebServerFactory;
import org.springframework.boot.web.server.servlet.ServletWebServerFactory;

View File

@ -2097,7 +2097,8 @@ bom {
"spring-boot-testcontainers",
"spring-boot-tomcat",
"spring-boot-tx",
"spring-boot-undertow"
"spring-boot-undertow",
"spring-boot-validation"
]
plugins = [
"spring-boot-maven-plugin"

View File

@ -72,6 +72,7 @@ dependencies {
autoConfiguration(project(path: ":spring-boot-project:spring-boot-tomcat", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-tx", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-undertow", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-validation", configuration: "autoConfigurationMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-activemq", configuration: "configurationPropertiesMetadata"))

View File

@ -6,6 +6,5 @@ description = "Starter for using Java Bean Validation with Hibernate Validator"
dependencies {
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter"))
api("org.apache.tomcat.embed:tomcat-embed-el")
api("org.hibernate.validator:hibernate-validator")
api(project(":spring-boot-project:spring-boot-validation"))
}

View File

@ -42,6 +42,7 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-jsonb"))
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
optional(project(":spring-boot-project:spring-boot-tx"))
optional(project(":spring-boot-project:spring-boot-validation"))
optional("jakarta.json.bind:jakarta.json.bind-api")
optional("jakarta.persistence:jakarta.persistence-api")
optional("jakarta.servlet:jakarta.servlet-api")

View File

@ -34,7 +34,7 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
* @since 2.7.0
* @see GraphQlTest
* @see org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration
* @see org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
* @see org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration
* @see org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration
*/
@Target(ElementType.TYPE)

View File

@ -1,4 +1,4 @@
# AutoConfigureGraphQl auto-configuration imports
org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
optional:org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration
org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration

View File

@ -4,6 +4,6 @@ org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration
org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
optional:org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration
org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration
org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration

View File

@ -8,7 +8,7 @@ org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfigurati
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration
org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
optional:org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration
org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration
org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -25,9 +25,9 @@ import org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration
import org.springframework.boot.autoconfigure.security.oauth2.client.reactive.ReactiveOAuth2ClientAutoConfiguration;
import org.springframework.boot.autoconfigure.security.oauth2.resource.reactive.ReactiveOAuth2ResourceServerAutoConfiguration;
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration;
import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest;
import org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration;
import org.springframework.context.ApplicationContext;
import static org.assertj.core.api.Assertions.assertThat;

View File

@ -0,0 +1,22 @@
plugins {
id "java-library"
id "org.springframework.boot.auto-configuration"
id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.deployed"
id "org.springframework.boot.optional-dependencies"
}
description = "Spring Boot Validation"
dependencies {
api(project(":spring-boot-project:spring-boot"))
api("org.apache.tomcat.embed:tomcat-embed-el")
api("org.hibernate.validator:hibernate-validator")
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testRuntimeOnly("ch.qos.logback:logback-classic")
}

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.validation;
package org.springframework.boot.validation.autoconfigure;
import jakarta.validation.Configuration;
import jakarta.validation.Validation;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.validation;
package org.springframework.boot.validation.autoconfigure;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.validation;
package org.springframework.boot.validation.autoconfigure;
import jakarta.validation.Validator;
import jakarta.validation.executable.ExecutableValidator;
@ -46,7 +46,7 @@ import org.springframework.validation.beanvalidation.MethodValidationPostProcess
* @author Stephane Nicoll
* @author Madhura Bhave
* @author Yanming Zhou
* @since 1.5.0
* @since 4.0.0
*/
@AutoConfiguration
@ConditionalOnClass(ExecutableValidator.class)

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.validation;
package org.springframework.boot.validation.autoconfigure;
import jakarta.validation.Configuration;
@ -22,7 +22,7 @@ import jakarta.validation.Configuration;
* Callback interface that can be used to customize {@link Configuration}.
*
* @author Dang Zhicairang
* @since 3.0.0
* @since 4.0.0
*/
@FunctionalInterface
public interface ValidationConfigurationCustomizer {

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.validation;
package org.springframework.boot.validation.autoconfigure;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ -25,7 +25,7 @@ import org.springframework.context.annotation.Role;
*
* @author Yanming Zhou
* @author Andy Wilkinson
* @since 3.5.0
* @since 4.0.0
*/
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@ConfigurationProperties("spring.validation")

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.validation;
package org.springframework.boot.validation.autoconfigure;
import jakarta.validation.ValidationException;
@ -40,7 +40,7 @@ import org.springframework.validation.beanvalidation.SpringValidatorAdapter;
* @author Stephane Nicoll
* @author Phillip Webb
* @author Zisis Pavloudis
* @since 2.0.0
* @since 4.0.0
*/
public class ValidatorAdapter implements SmartValidator, ApplicationContextAware, InitializingBean, DisposableBean {

View File

@ -17,4 +17,4 @@
/**
* Auto-configuration for (JSR-303) Validation.
*/
package org.springframework.boot.autoconfigure.validation;
package org.springframework.boot.validation.autoconfigure;

View File

@ -0,0 +1,3 @@
# Background Preinitializers
org.springframework.boot.autoconfigure.preinitialize.BackgroundPreinitializer=\
org.springframework.boot.validation.autoconfigure.JakartaValidationBackgroundPreinitializer

View File

@ -0,0 +1 @@
org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.validation;
package org.springframework.boot.validation.autoconfigure;
import java.util.HashSet;
import java.util.Set;
@ -32,9 +32,9 @@ import org.springframework.beans.factory.BeanFactoryUtils;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfigurationTests.CustomValidatorConfiguration.TestBeanPostProcessor;
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.validation.autoconfigure.ValidationAutoConfigurationTests.CustomValidatorConfiguration.TestBeanPostProcessor;
import org.springframework.boot.validation.beanvalidation.MethodValidationExcludeFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.validation;
package org.springframework.boot.validation.autoconfigure;
import jakarta.validation.Validator;
import org.junit.jupiter.api.Test;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.validation;
package org.springframework.boot.validation.autoconfigure;
import jakarta.validation.Validator;
import org.junit.jupiter.api.Test;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.validation;
package org.springframework.boot.validation.autoconfigure;
import org.junit.jupiter.api.Test;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.validation;
package org.springframework.boot.validation.autoconfigure;
import java.util.HashMap;