From a00ad72881c9d73eb69baa6ba308c9625c364ac6 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 2 Jun 2017 11:27:18 +0200 Subject: [PATCH] Add json starter This commit adds a new json starter that gathers the core bits to read and write json with dedicated Java 8 extensions. The web-related starters have been improved to use the new starter rather than relying on `jackson-databind` directly. Closes gh-9297 --- spring-boot-dependencies/pom.xml | 5 +++ spring-boot-starters/pom.xml | 1 + .../spring-boot-starter-data-rest/pom.xml | 10 ++---- .../spring-boot-starter-jersey/pom.xml | 8 ++--- .../spring-boot-starter-json/pom.xml | 34 +++++++++++++++++++ .../main/resources/META-INF/spring.provides | 1 + .../spring-boot-starter-web/pom.xml | 8 ++--- .../spring-boot-starter-webflux/pom.xml | 6 ++-- .../main/resources/META-INF/spring.provides | 2 +- 9 files changed, 56 insertions(+), 19 deletions(-) create mode 100644 spring-boot-starters/spring-boot-starter-json/pom.xml create mode 100644 spring-boot-starters/spring-boot-starter-json/src/main/resources/META-INF/spring.provides diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 38828932d6..c986d7ddf5 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -448,6 +448,11 @@ spring-boot-starter-jooq 2.0.0.BUILD-SNAPSHOT + + org.springframework.boot + spring-boot-starter-json + 2.0.0.BUILD-SNAPSHOT + org.springframework.boot spring-boot-starter-jta-atomikos diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml index ddf430ce25..cfa135e5f9 100644 --- a/spring-boot-starters/pom.xml +++ b/spring-boot-starters/pom.xml @@ -49,6 +49,7 @@ spring-boot-starter-jersey spring-boot-starter-jetty spring-boot-starter-jooq + spring-boot-starter-json spring-boot-starter-jta-atomikos spring-boot-starter-jta-bitronix spring-boot-starter-jta-narayana diff --git a/spring-boot-starters/spring-boot-starter-data-rest/pom.xml b/spring-boot-starters/spring-boot-starter-data-rest/pom.xml index ec3b11ba78..f7e3326b80 100644 --- a/spring-boot-starters/spring-boot-starter-data-rest/pom.xml +++ b/spring-boot-starters/spring-boot-starter-data-rest/pom.xml @@ -25,15 +25,11 @@ org.springframework.boot - spring-boot-starter-web - - - com.fasterxml.jackson.core - jackson-annotations + spring-boot-starter-json - com.fasterxml.jackson.core - jackson-databind + org.springframework.boot + spring-boot-starter-web org.springframework.data diff --git a/spring-boot-starters/spring-boot-starter-jersey/pom.xml b/spring-boot-starters/spring-boot-starter-jersey/pom.xml index afd2940c1b..9563031dc5 100644 --- a/spring-boot-starters/spring-boot-starter-jersey/pom.xml +++ b/spring-boot-starters/spring-boot-starter-jersey/pom.xml @@ -25,15 +25,15 @@ org.springframework.boot - spring-boot-starter-tomcat + spring-boot-starter-json org.springframework.boot - spring-boot-starter-validation + spring-boot-starter-tomcat - com.fasterxml.jackson.core - jackson-databind + org.springframework.boot + spring-boot-starter-validation org.springframework diff --git a/spring-boot-starters/spring-boot-starter-json/pom.xml b/spring-boot-starters/spring-boot-starter-json/pom.xml new file mode 100644 index 0000000000..1129d86bf2 --- /dev/null +++ b/spring-boot-starters/spring-boot-starter-json/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starters + 2.0.0.BUILD-SNAPSHOT + + spring-boot-starter-json + Spring Boot Json Starter + Starter for reading and writing json + http://projects.spring.io/spring-boot/ + + Pivotal Software, Inc. + http://www.spring.io + + + ${basedir}/../.. + + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.datatype + jackson-datatype-jdk8 + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + diff --git a/spring-boot-starters/spring-boot-starter-json/src/main/resources/META-INF/spring.provides b/spring-boot-starters/spring-boot-starter-json/src/main/resources/META-INF/spring.provides new file mode 100644 index 0000000000..35aa6c645b --- /dev/null +++ b/spring-boot-starters/spring-boot-starter-json/src/main/resources/META-INF/spring.provides @@ -0,0 +1 @@ +provides: jackson-databind,jackson-datatype-jdk8,jackson-datatype-jsr310 \ 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 a2337087b2..dcad4603b6 100644 --- a/spring-boot-starters/spring-boot-starter-web/pom.xml +++ b/spring-boot-starters/spring-boot-starter-web/pom.xml @@ -23,6 +23,10 @@ org.springframework.boot spring-boot-starter + + org.springframework.boot + spring-boot-starter-json + org.springframework.boot spring-boot-starter-tomcat @@ -31,10 +35,6 @@ org.hibernate hibernate-validator - - com.fasterxml.jackson.core - jackson-databind - org.springframework spring-web diff --git a/spring-boot-starters/spring-boot-starter-webflux/pom.xml b/spring-boot-starters/spring-boot-starter-webflux/pom.xml index 208380826e..c3c31813fc 100644 --- a/spring-boot-starters/spring-boot-starter-webflux/pom.xml +++ b/spring-boot-starters/spring-boot-starter-webflux/pom.xml @@ -25,11 +25,11 @@ org.springframework.boot - spring-boot-starter-reactor-netty + spring-boot-starter-json - com.fasterxml.jackson.core - jackson-databind + org.springframework.boot + spring-boot-starter-reactor-netty org.hibernate diff --git a/spring-boot-starters/spring-boot-starter-webflux/src/main/resources/META-INF/spring.provides b/spring-boot-starters/spring-boot-starter-webflux/src/main/resources/META-INF/spring.provides index 9c0d58c173..2e3b26f34c 100644 --- a/spring-boot-starters/spring-boot-starter-webflux/src/main/resources/META-INF/spring.provides +++ b/spring-boot-starters/spring-boot-starter-webflux/src/main/resources/META-INF/spring.provides @@ -1 +1 @@ -provides: spring-webflux \ No newline at end of file +provides: spring-webflux,jackson-databind \ No newline at end of file