Spring Boot 2. hibernate validate 版本冲突导致严重失效

Spring Boot 2.0 hibernate validate 版本冲突导致严重失效


​​​​​​​HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.String'. Check configuration for 'your filed'"

​​​​​​​

导致问题原因


某个工具jar包中引入的低版本的hibernate-validate依赖

 

解决办法

找到依赖冲突的工具jar包,使用maven的排除标签排除工具类的hibernate依赖使用spring boot 2.0 自带的版本

        <dependency>
            <groupId>your.tool.group</groupId>
            <artifactId>your.tool</artifactId>
            <version>1.0.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-validator</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

 

Spring Boot 2. hibernate validate 版本冲突导致严重失效

相关文章:

你感兴趣的文章:

标签云: