billc.cn
billc.cn

Reputation: 7317

Standalone maven package for hibernate validator annotations

A quick question: is there a stand-alone package for org.hibernate.validator.constraints.*?

I want to put these annotations on a DTO package, but don't want to force the user to have hibernate-validator on their class path.

Upvotes: 4

Views: 1506

Answers (2)

Hardy
Hardy

Reputation: 19129

If you use custom Hibernate Validator constraints you would have to add the actual core classes as well anyways. As long as you rely on Bean Validation constraints (javax.validation.*) it is enough to add the Bean Validation API jar.

What is your concen with adding the hibernate Validator jar?

Upvotes: 0

maba
maba

Reputation: 48095

I don't really 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 the annotations in 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 the org.hibernate.validator.constraints as a dependency w/o all the other validation stuff.

Then my answer is no, there is no such thin jar. You will have to use the hibernate-validator to get the annotations.

Upvotes: 1

Related Questions