Skip to content

Commit

Permalink
validation - Extracting hibernate validator dependency from restx-cor…
Browse files Browse the repository at this point in the history
…e 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
  • Loading branch information
fcamblor committed Dec 22, 2014
1 parent 6b440af commit 6989675
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
<module>restx-shell-manager</module>
<module>restx-build-shell</module>
<module>restx-specs-shell</module>
<module>restx-validation</module>
</modules>


Expand Down
8 changes: 4 additions & 4 deletions restx-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<joda-time.version>2.3</joda-time.version>
<jackson.version>2.3.3</jackson.version>
<snakeyaml.version>1.13</snakeyaml.version>
<hibernate-validator.version>5.0.1.Final</hibernate-validator.version>
<validation-api.version>1.1.0.Final</validation-api.version>
<reflections.version>0.9.9-RC1</reflections.version>
<javax.inject.version>1</javax.inject.version>
<junit.version>4.11</junit.version>
Expand Down Expand Up @@ -94,9 +94,9 @@
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${validation-api.version}</version>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
Expand Down
38 changes: 38 additions & 0 deletions restx-validation/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>io.restx</groupId>
<artifactId>restx-parent</artifactId>
<version>0.34-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>io.restx</groupId>
<artifactId>restx-validation</artifactId>
<version>0.34-SNAPSHOT</version>
<packaging>jar</packaging>
<name>restx-validation</name>

<properties>
<restx.version>0.34-SNAPSHOT</restx.version>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source>
<hibernate-validator.version>5.0.1.Final</hibernate-validator.version>
</properties>

<dependencies>
<dependency>
<groupId>io.restx</groupId>
<artifactId>restx-factory</artifactId>
<version>${restx.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package restx.validation;

import org.hibernate.validator.HibernateValidator;
import restx.factory.*;
import restx.factory.Module;
import restx.factory.Name;
import restx.factory.Provides;

import javax.inject.Named;
import javax.validation.Validation;
Expand Down

0 comments on commit 6989675

Please sign in to comment.