Stand-alone maven package for hibernation validator annotations

Quick question: is there a separate package for org.hibernate.validator.constraints.* ?

I want to put these annotations in a DTO package, but I do not want to force the user to have a hibernate-validator in their class path.

+4
source share
2 answers

I don't know what you mean by standalone in this context, but here is a link to the 4.3.1 version of hibernate-validator .

Adding this to your pom will give you access to all annotations in the org.hibernate.validator.constraints package:

 <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.3.0.Final</version> </dependency> 

mvnrepository.com is a very good place to search for maven artifacts.


Edit

Ok, now I understand your question, you only want the annotations in org.hibernate.validator.constraints be dependent on all other validation materials.

Then my answer is no, there is no such thin can. You will need to use hibernate-validator to get annotations.

+1
source

If you use the user restrictions of the Hibernate Validator, you will also need to add real kernel classes. As long as you rely on Bean validation restrictions (javax.validation. *), Just add the Bean jar to the validation API.

What is your concentration with jibernate Validator jar?

0
source

Source: https://habr.com/ru/post/1443004/


All Articles