Skip to content

Commit 6989675

Browse files
committed
validation - Extracting hibernate validator dependency from restx-core to new restx-validation module. [BREAKING]
It means that to activate bean validation, you will need to explicitely add a dependency on restx-validation module on your project. Startup time on project not using restx-validation will then be improved (no hibernate validator will be loaded) for ~250ms
1 parent 6b440af commit 6989675

4 files changed

Lines changed: 46 additions & 5 deletions

File tree

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
<module>restx-shell-manager</module>
159159
<module>restx-build-shell</module>
160160
<module>restx-specs-shell</module>
161+
<module>restx-validation</module>
161162
</modules>
162163

163164

restx-core/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<joda-time.version>2.3</joda-time.version>
2626
<jackson.version>2.3.3</jackson.version>
2727
<snakeyaml.version>1.13</snakeyaml.version>
28-
<hibernate-validator.version>5.0.1.Final</hibernate-validator.version>
28+
<validation-api.version>1.1.0.Final</validation-api.version>
2929
<reflections.version>0.9.9-RC1</reflections.version>
3030
<javax.inject.version>1</javax.inject.version>
3131
<junit.version>4.11</junit.version>
@@ -94,9 +94,9 @@
9494
<version>${slf4j-api.version}</version>
9595
</dependency>
9696
<dependency>
97-
<groupId>org.hibernate</groupId>
98-
<artifactId>hibernate-validator</artifactId>
99-
<version>${hibernate-validator.version}</version>
97+
<groupId>javax.validation</groupId>
98+
<artifactId>validation-api</artifactId>
99+
<version>${validation-api.version}</version>
100100
</dependency>
101101
<dependency>
102102
<groupId>org.reflections</groupId>

restx-validation/pom.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<groupId>io.restx</groupId>
7+
<artifactId>restx-parent</artifactId>
8+
<version>0.34-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<groupId>io.restx</groupId>
13+
<artifactId>restx-validation</artifactId>
14+
<version>0.34-SNAPSHOT</version>
15+
<packaging>jar</packaging>
16+
<name>restx-validation</name>
17+
18+
<properties>
19+
<restx.version>0.34-SNAPSHOT</restx.version>
20+
<maven.compiler.target>1.7</maven.compiler.target>
21+
<maven.compiler.source>1.7</maven.compiler.source>
22+
<hibernate-validator.version>5.0.1.Final</hibernate-validator.version>
23+
</properties>
24+
25+
<dependencies>
26+
<dependency>
27+
<groupId>io.restx</groupId>
28+
<artifactId>restx-factory</artifactId>
29+
<version>${restx.version}</version>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.hibernate</groupId>
33+
<artifactId>hibernate-validator</artifactId>
34+
<version>${hibernate-validator.version}</version>
35+
</dependency>
36+
</dependencies>
37+
38+
</project>

restx-core/src/main/java/restx/validation/ValidatorFactory.java renamed to restx-validation/src/main/java/restx/validation/ValidatorFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package restx.validation;
22

33
import org.hibernate.validator.HibernateValidator;
4-
import restx.factory.*;
4+
import restx.factory.Module;
5+
import restx.factory.Name;
6+
import restx.factory.Provides;
57

68
import javax.inject.Named;
79
import javax.validation.Validation;

0 commit comments

Comments
 (0)