Skip to content

Commit f7f4627

Browse files
mhalbritterwilkinsona
authored andcommitted
Create spring-boot-gson module
1 parent aa56358 commit f7f4627

File tree

20 files changed

+51
-29
lines changed

20 files changed

+51
-29
lines changed

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ include "spring-boot-project:spring-boot-elasticsearch"
6262
include "spring-boot-project:spring-boot-flyway"
6363
include "spring-boot-project:spring-boot-freemarker"
6464
include "spring-boot-project:spring-boot-groovy-templates"
65+
include "spring-boot-project:spring-boot-gson"
6566
include "spring-boot-project:spring-boot-hazelcast"
6667
include "spring-boot-project:spring-boot-integration"
6768
include "spring-boot-project:spring-boot-jackson"

spring-boot-project/spring-boot-autoconfigure-all/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ dependencies {
6969
optional("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
7070
optional("com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations")
7171
optional("com.fasterxml.jackson.module:jackson-module-parameter-names")
72-
optional("com.google.code.gson:gson")
7372
optional("com.hazelcast:hazelcast-spring")
7473
optional("com.h2database:h2")
7574
optional("com.nimbusds:oauth2-oidc-sdk")
@@ -218,6 +217,7 @@ dependencies {
218217
optional("redis.clients:jedis")
219218

220219
testImplementation(project(":spring-boot-project:spring-boot-freemarker"))
220+
testImplementation(project(":spring-boot-project:spring-boot-gson"))
221221
testImplementation(project(":spring-boot-project:spring-boot-jetty"))
222222
testImplementation(project(":spring-boot-project:spring-boot-test"))
223223
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))

spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
2828
import org.springframework.boot.autoconfigure.condition.NoneNestedConditions;
29-
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
3029
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration.HttpMessageConvertersAutoConfigurationRuntimeHints;
3130
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration.NotReactiveWebApplicationCondition;
3231
import org.springframework.boot.context.properties.bind.BindableRuntimeHintsRegistrar;
@@ -55,9 +54,9 @@
5554
* @author Eddú Meléndez
5655
* @since 2.0.0
5756
*/
58-
@AutoConfiguration(after = { GsonAutoConfiguration.class },
59-
afterName = { "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration",
60-
"org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration" })
57+
@AutoConfiguration(afterName = { "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration",
58+
"org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration",
59+
"org.springframework.boot.gson.autoconfigure.GsonAutoConfiguration" })
6160
@ConditionalOnClass(HttpMessageConverter.class)
6261
@Conditional(NotReactiveWebApplicationCondition.class)
6362
@Import({ JacksonHttpMessageConvertersConfiguration.class, GsonHttpMessageConvertersConfiguration.class,

spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ org.springframework.boot.autoconfigure.graphql.rsocket.RSocketGraphQlClientAutoC
3939
org.springframework.boot.autoconfigure.graphql.security.GraphQlWebFluxSecurityAutoConfiguration
4040
org.springframework.boot.autoconfigure.graphql.security.GraphQlWebMvcSecurityAutoConfiguration
4141
org.springframework.boot.autoconfigure.graphql.servlet.GraphQlWebMvcAutoConfiguration
42-
org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration
4342
org.springframework.boot.autoconfigure.h2.H2ConsoleAutoConfiguration
4443
org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration
4544
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration

spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
2828
import org.springframework.beans.factory.config.BeanDefinition;
2929
import org.springframework.boot.autoconfigure.AutoConfigurations;
30-
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
3130
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration.HttpMessageConvertersAutoConfigurationRuntimeHints;
3231
import org.springframework.boot.autoconfigure.http.JacksonHttpMessageConvertersConfiguration.MappingJackson2HttpMessageConverterConfiguration;
3332
import org.springframework.boot.autoconfigure.web.ServerProperties;
33+
import org.springframework.boot.gson.autoconfigure.GsonAutoConfiguration;
3434
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
3535
import org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration;
3636
import org.springframework.boot.test.context.FilteredClassLoader;

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,6 +2005,7 @@ bom {
20052005
"spring-boot-flyway",
20062006
"spring-boot-freemarker",
20072007
"spring-boot-groovy-templates",
2008+
"spring-boot-gson",
20082009
"spring-boot-hazelcast",
20092010
"spring-boot-integration",
20102011
"spring-boot-jackson",

spring-boot-project/spring-boot-docs/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ dependencies {
6868
autoConfiguration(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "autoConfigurationMetadata"))
6969
autoConfiguration(project(path: ":spring-boot-project:spring-boot-flyway", configuration: "autoConfigurationMetadata"))
7070
autoConfiguration(project(path: ":spring-boot-project:spring-boot-freemarker", configuration: "autoConfigurationMetadata"))
71+
autoConfiguration(project(path: ":spring-boot-project:spring-boot-gson", configuration: "autoConfigurationMetadata"))
7172
autoConfiguration(project(path: ":spring-boot-project:spring-boot-hazelcast", configuration: "autoConfigurationMetadata"))
7273
autoConfiguration(project(path: ":spring-boot-project:spring-boot-integration", configuration: "autoConfigurationMetadata"))
7374
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "autoConfigurationMetadata"))
@@ -114,6 +115,7 @@ dependencies {
114115
configurationProperties(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "configurationPropertiesMetadata"))
115116
configurationProperties(project(path: ":spring-boot-project:spring-boot-flyway", configuration: "configurationPropertiesMetadata"))
116117
configurationProperties(project(path: ":spring-boot-project:spring-boot-freemarker", configuration: "configurationPropertiesMetadata"))
118+
configurationProperties(project(path: ":spring-boot-project:spring-boot-gson", configuration: "configurationPropertiesMetadata"))
117119
configurationProperties(project(path: ":spring-boot-project:spring-boot-hazelcast", configuration: "configurationPropertiesMetadata"))
118120
configurationProperties(project(path: ":spring-boot-project:spring-boot-integration", configuration: "configurationPropertiesMetadata"))
119121
configurationProperties(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "configurationPropertiesMetadata"))
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins {
2+
id "java-library"
3+
id "org.springframework.boot.auto-configuration"
4+
id "org.springframework.boot.configuration-properties"
5+
id "org.springframework.boot.deployed"
6+
id "org.springframework.boot.optional-dependencies"
7+
}
8+
9+
description = "Spring Boot GSON"
10+
11+
dependencies {
12+
api(project(":spring-boot-project:spring-boot"))
13+
api("com.google.code.gson:gson")
14+
15+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
16+
17+
testImplementation(project(":spring-boot-project:spring-boot-test"))
18+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
19+
20+
testRuntimeOnly("ch.qos.logback:logback-classic")
21+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.gson;
17+
package org.springframework.boot.gson.autoconfigure;
1818

1919
import java.util.List;
2020
import java.util.function.Consumer;
@@ -38,7 +38,7 @@
3838
*
3939
* @author David Liu
4040
* @author Ivan Golovko
41-
* @since 1.2.0
41+
* @since 4.0.0
4242
*/
4343
@AutoConfiguration
4444
@ConditionalOnClass(Gson.class)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.gson;
17+
package org.springframework.boot.gson.autoconfigure;
1818

1919
import com.google.gson.Gson;
2020
import com.google.gson.GsonBuilder;
@@ -24,7 +24,7 @@
2424
* {@link Gson} through {@link GsonBuilder} retaining its default auto-configuration.
2525
*
2626
* @author Ivan Golovko
27-
* @since 2.0.0
27+
* @since 4.0.0
2828
*/
2929
@FunctionalInterface
3030
public interface GsonBuilderCustomizer {

0 commit comments

Comments
 (0)