From 346392d31b978ba575ac69954d085ce35fd250a6 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 30 Mar 2015 14:01:48 +0100 Subject: [PATCH] Introduce a validation starter Previously, the only starter that provided validation was spring-boot-starter-web which included Hibernate Validator and Tomcat's EL implementation. This left users writing non-web applications to figure out the dependencies for themselves. They would sometimes run into difficulties as Hibernate Validator's need for an EL implementation would trip them up. This commit adds a new starter, spring-boot-starter-validation, which provides both Hibernate Validator and Tomcat's EL implementation. spring-boot-starter-web has been updated to depend on this starter rather than depending on Hibernate Validator directly. Closes gh-2678 --- spring-boot-dependencies/pom.xml | 5 +++ spring-boot-starters/pom.xml | 1 + .../spring-boot-starter-jersey/pom.xml | 8 ++--- .../spring-boot-starter-validation/pom.xml | 34 +++++++++++++++++++ .../main/resources/META-INF/spring.provides | 1 + .../spring-boot-starter-web/pom.xml | 8 ++--- 6 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 spring-boot-starters/spring-boot-starter-validation/pom.xml create mode 100644 spring-boot-starters/spring-boot-starter-validation/src/main/resources/META-INF/spring.provides diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index ab19c599294..9abdddf5eb6 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -393,6 +393,11 @@ spring-boot-starter-tomcat 1.3.0.BUILD-SNAPSHOT + + org.springframework.boot + spring-boot-starter-validation + 1.3.0.BUILD-SNAPSHOT + org.springframework.boot spring-boot-starter-velocity diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml index c9206fa978f..120ad5666b2 100644 --- a/spring-boot-starters/pom.xml +++ b/spring-boot-starters/pom.xml @@ -59,6 +59,7 @@ spring-boot-starter-thymeleaf spring-boot-starter-tomcat spring-boot-starter-undertow + spring-boot-starter-validation spring-boot-starter-velocity spring-boot-starter-web spring-boot-starter-websocket diff --git a/spring-boot-starters/spring-boot-starter-jersey/pom.xml b/spring-boot-starters/spring-boot-starter-jersey/pom.xml index 85571af6920..3559d19a8f4 100644 --- a/spring-boot-starters/spring-boot-starter-jersey/pom.xml +++ b/spring-boot-starters/spring-boot-starter-jersey/pom.xml @@ -27,12 +27,12 @@ spring-boot-starter-tomcat - com.fasterxml.jackson.core - jackson-databind + org.springframework.boot + spring-boot-starter-validation - org.hibernate - hibernate-validator + com.fasterxml.jackson.core + jackson-databind org.springframework diff --git a/spring-boot-starters/spring-boot-starter-validation/pom.xml b/spring-boot-starters/spring-boot-starter-validation/pom.xml new file mode 100644 index 00000000000..06e6ff16429 --- /dev/null +++ b/spring-boot-starters/spring-boot-starter-validation/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starters + 1.3.0.BUILD-SNAPSHOT + + spring-boot-starter-validation + Spring Boot Validation Starter + Spring Boot Validation Starter + http://projects.spring.io/spring-boot/ + + Pivotal Software, Inc. + http://www.spring.io + + + ${basedir}/../.. + + + + org.springframework.boot + spring-boot-starter + + + org.apache.tomcat.embed + tomcat-embed-el + + + org.hibernate + hibernate-validator + + + diff --git a/spring-boot-starters/spring-boot-starter-validation/src/main/resources/META-INF/spring.provides b/spring-boot-starters/spring-boot-starter-validation/src/main/resources/META-INF/spring.provides new file mode 100644 index 00000000000..ea07153b7bc --- /dev/null +++ b/spring-boot-starters/spring-boot-starter-validation/src/main/resources/META-INF/spring.provides @@ -0,0 +1 @@ +provides: hibernate-validator \ No newline at end of file diff --git a/spring-boot-starters/spring-boot-starter-web/pom.xml b/spring-boot-starters/spring-boot-starter-web/pom.xml index 4490d85465a..4fad41d8513 100644 --- a/spring-boot-starters/spring-boot-starter-web/pom.xml +++ b/spring-boot-starters/spring-boot-starter-web/pom.xml @@ -27,12 +27,12 @@ spring-boot-starter-tomcat - com.fasterxml.jackson.core - jackson-databind + org.springframework.boot + spring-boot-starter-validation - org.hibernate - hibernate-validator + com.fasterxml.jackson.core + jackson-databind org.springframework