Java Reference
In-Depth Information
<scope>provided</scope>
</dependency>
Next, since we will be using
JSR-303 Bean Validation
in our example, we need to
include the
hibernate-validator
artifact as well.
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
When declaring the
hibernate-validator
dependency, we are using an
explicit
exclusion
for the
slf4j
API, which will not be added to the project's classpath since
we use the
java.util logging
API instead.
Finally, we will add one more hibernate dependency - the
annotation processor
that will check for compilation errors whenever constraint annotations are incorrectly
used.
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-annotation-processor</artifactId>
<scope>provided</scope>
</dependency>
Dependency Injection
(since the examples in this topic grow incrementally in com-