Skip to content

Commit b9a53f0

Browse files
committed
Create spring-boot-jsonb module
1 parent 2a73ca0 commit b9a53f0

File tree

22 files changed

+56
-21
lines changed

22 files changed

+56
-21
lines changed

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ include "spring-boot-project:spring-boot-devtools"
6969
include "spring-boot-project:spring-boot-docs"
7070
include "spring-boot-project:spring-boot-jackson"
7171
include "spring-boot-project:spring-boot-jetty"
72+
include "spring-boot-project:spring-boot-jsonb"
7273
include "spring-boot-project:spring-boot-mail"
7374
include "spring-boot-project:spring-boot-reactor-netty"
7475
include "spring-boot-project:spring-boot-test"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies {
2020
optional(project(":spring-boot-project:spring-boot-amqp"))
2121
optional(project(":spring-boot-project:spring-boot-jackson"))
2222
optional(project(":spring-boot-project:spring-boot-jetty"))
23+
optional(project(":spring-boot-project:spring-boot-jsonb"))
2324
optional(project(":spring-boot-project:spring-boot-mail"))
2425
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
2526
optional(project(":spring-boot-project:spring-boot-tomcat"))

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependencies {
2424
dockerTestImplementation("org.testcontainers:testcontainers")
2525

2626
optional(project(":spring-boot-project:spring-boot-jetty"))
27+
optional(project(":spring-boot-project:spring-boot-jsonb"))
2728
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
2829
optional(project(":spring-boot-project:spring-boot-tomcat"))
2930
optional(project(":spring-boot-project:spring-boot-undertow"))
@@ -97,6 +98,7 @@ dependencies {
9798

9899
testImplementation(project(":spring-boot-project:spring-boot-autoconfigure-all"))
99100
testImplementation(project(":spring-boot-project:spring-boot-jackson"))
101+
testImplementation(project(":spring-boot-project:spring-boot-jsonb"))
100102
testImplementation(project(":spring-boot-project:spring-boot-reactor-netty"))
101103
testImplementation(project(":spring-boot-project:spring-boot-test"))
102104
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ dependencies {
4343
dockerTestImplementation("org.testcontainers:testcontainers")
4444

4545
optional(project(":spring-boot-project:spring-boot-jackson"))
46+
optional(project(":spring-boot-project:spring-boot-jsonb"))
4647
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
4748
optional(project(":spring-boot-project:spring-boot-tomcat"))
4849
optional("co.elastic.clients:elasticsearch-java") {

spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchClientAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchClientConfigurations.ElasticsearchClientConfiguration;
2727
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchClientConfigurations.ElasticsearchTransportConfiguration;
2828
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchClientConfigurations.JsonpMapperConfiguration;
29-
import org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration;
3029
import org.springframework.context.annotation.Import;
3130

3231
/**
@@ -35,7 +34,8 @@
3534
* @author Andy Wilkinson
3635
* @since 3.0.0
3736
*/
38-
@AutoConfiguration(after = { JsonbAutoConfiguration.class, ElasticsearchRestClientAutoConfiguration.class })
37+
@AutoConfiguration(after = { ElasticsearchRestClientAutoConfiguration.class },
38+
afterName = { "org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration" })
3939
@ConditionalOnBean(RestClient.class)
4040
@ConditionalOnClass(ElasticsearchClient.class)
4141
@Import({ JsonpMapperConfiguration.class, ElasticsearchTransportConfiguration.class,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
3030
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration.HttpMessageConvertersAutoConfigurationRuntimeHints;
3131
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration.NotReactiveWebApplicationCondition;
32-
import org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration;
3332
import org.springframework.boot.context.properties.bind.BindableRuntimeHintsRegistrar;
3433
import org.springframework.boot.context.properties.bind.Binder;
3534
import org.springframework.boot.web.server.servlet.Encoding;
@@ -56,8 +55,9 @@
5655
* @author Eddú Meléndez
5756
* @since 2.0.0
5857
*/
59-
@AutoConfiguration(after = { GsonAutoConfiguration.class, JsonbAutoConfiguration.class },
60-
afterName = "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration")
58+
@AutoConfiguration(after = { GsonAutoConfiguration.class },
59+
afterName = { "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration",
60+
"org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration" })
6161
@ConditionalOnClass(HttpMessageConverter.class)
6262
@Conditional(NotReactiveWebApplicationCondition.class)
6363
@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
@@ -72,7 +72,6 @@ org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguratio
7272
org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration
7373
org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration
7474
org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration
75-
org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration
7675
org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration
7776
org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration
7877
org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration

spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchClientAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import org.junit.jupiter.api.Test;
2929

3030
import org.springframework.boot.autoconfigure.AutoConfigurations;
31-
import org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration;
3231
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
32+
import org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration;
3333
import org.springframework.boot.test.context.FilteredClassLoader;
3434
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
3535
import org.springframework.context.annotation.Bean;

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
@@ -30,9 +30,9 @@
3030
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
3131
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration.HttpMessageConvertersAutoConfigurationRuntimeHints;
3232
import org.springframework.boot.autoconfigure.http.JacksonHttpMessageConvertersConfiguration.MappingJackson2HttpMessageConverterConfiguration;
33-
import org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration;
3433
import org.springframework.boot.autoconfigure.web.ServerProperties;
3534
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
35+
import org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration;
3636
import org.springframework.boot.test.context.FilteredClassLoader;
3737
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
3838
import org.springframework.boot.test.context.runner.ApplicationContextRunner;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,6 +2038,7 @@ bom {
20382038
"spring-boot-jackson",
20392039
"spring-boot-jarmode-tools",
20402040
"spring-boot-jetty",
2041+
"spring-boot-jsonb",
20412042
"spring-boot-loader",
20422043
"spring-boot-loader-classic",
20432044
"spring-boot-loader-tools",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ dependencies {
5757
autoConfiguration(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "autoConfigurationMetadata"))
5858
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "autoConfigurationMetadata"))
5959
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "autoConfigurationMetadata"))
60+
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jsonb", configuration: "autoConfigurationMetadata"))
6061
autoConfiguration(project(path: ":spring-boot-project:spring-boot-mail", configuration: "autoConfigurationMetadata"))
6162
autoConfiguration(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "autoConfigurationMetadata"))
6263
autoConfiguration(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "autoConfigurationMetadata"))
@@ -90,6 +91,7 @@ dependencies {
9091
implementation(project(path: ":spring-boot-project:spring-boot-devtools"))
9192
implementation(project(path: ":spring-boot-project:spring-boot-docker-compose"))
9293
implementation(project(path: ":spring-boot-project:spring-boot-jackson"))
94+
implementation(project(path: ":spring-boot-project:spring-boot-jsonb"))
9395
implementation(project(path: ":spring-boot-project:spring-boot-reactor-netty"))
9496
implementation(project(path: ":spring-boot-project:spring-boot-test"))
9597
implementation(project(path: ":spring-boot-project:spring-boot-test-autoconfigure"))
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
plugins {
2+
id "java-library"
3+
id "org.springframework.boot.auto-configuration"
4+
id "org.springframework.boot.deployed"
5+
id "org.springframework.boot.optional-dependencies"
6+
}
7+
8+
description = "Spring Boot JSON-B"
9+
10+
dependencies {
11+
api(project(":spring-boot-project:spring-boot"))
12+
api("jakarta.json.bind:jakarta.json.bind-api")
13+
14+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
15+
16+
testImplementation(project(":spring-boot-project:spring-boot-test"))
17+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
18+
testImplementation("org.eclipse:yasson")
19+
testImplementation("org.assertj:assertj-core")
20+
testImplementation("org.awaitility:awaitility")
21+
testImplementation("org.junit.jupiter:junit-jupiter")
22+
testImplementation("org.mockito:mockito-core")
23+
testImplementation("org.mockito:mockito-junit-jupiter")
24+
25+
testRuntimeOnly("ch.qos.logback:logback-classic")
26+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 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.jsonb;
17+
package org.springframework.boot.jsonb.autoconfigure;
1818

1919
import jakarta.json.bind.Jsonb;
2020
import jakarta.json.bind.JsonbBuilder;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
/**
1818
* Auto-configuration for JSON-B.
1919
*/
20-
package org.springframework.boot.autoconfigure.jsonb;
20+
package org.springframework.boot.jsonb.autoconfigure;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration
Lines changed: 2 additions & 2 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.jsonb;
17+
package org.springframework.boot.jsonb.autoconfigure;
1818

1919
import jakarta.json.bind.Jsonb;
2020
import org.junit.jupiter.api.Test;
Lines changed: 2 additions & 2 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.jsonb;
17+
package org.springframework.boot.jsonb.autoconfigure;
1818

1919
import jakarta.json.bind.Jsonb;
2020
import org.junit.jupiter.api.Test;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dependencies {
3535
dockerTestRuntimeOnly("org.springframework.data:spring-data-redis")
3636

3737
optional(project(":spring-boot-project:spring-boot-jackson"))
38+
optional(project(":spring-boot-project:spring-boot-jsonb"))
3839
optional("jakarta.json.bind:jakarta.json.bind-api")
3940
optional("jakarta.persistence:jakarta.persistence-api")
4041
optional("jakarta.servlet:jakarta.servlet-api")

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
4040
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
4141
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
42-
import org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration;
4342
import org.springframework.boot.test.json.AbstractJsonMarshalTester;
4443
import org.springframework.boot.test.json.BasicJsonTester;
4544
import org.springframework.boot.test.json.GsonTester;
@@ -61,8 +60,9 @@
6160
* @since 1.4.0
6261
* @see AutoConfigureJsonTesters
6362
*/
64-
@AutoConfiguration(after = { GsonAutoConfiguration.class, JsonbAutoConfiguration.class },
65-
afterName = "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration")
63+
@AutoConfiguration(after = { GsonAutoConfiguration.class },
64+
afterName = { "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration",
65+
"org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration" })
6666
@ConditionalOnClass(name = "org.assertj.core.api.Assert")
6767
@ConditionalOnBooleanProperty("spring.test.jsontesters.enabled")
6868
public class JsonTestersAutoConfiguration {

spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.elasticsearch.AutoConfigureDataElasticsearch.imports

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchR
55
org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchClientAutoConfiguration
66
org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration
77
org.springframework.boot.autoconfigure.elasticsearch.ReactiveElasticsearchClientAutoConfiguration
8-
org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration
98
org.springframework.boot.autoconfigure.ssl.SslAutoConfiguration
109
org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration
10+
optional:org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration
1111
optional:org.springframework.boot.testcontainers.service.connection.ServiceConnectionAutoConfiguration
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# AutoConfigureJson auto-configuration imports
22
org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration
3-
org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration
43
org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration
4+
optional:org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration

spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
2626
import org.springframework.aot.test.generate.TestGenerationContext;
2727
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
28-
import org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration;
2928
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
29+
import org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration;
3030
import org.springframework.boot.test.json.BasicJsonTester;
3131
import org.springframework.boot.test.json.GsonTester;
3232
import org.springframework.boot.test.json.JacksonTester;

0 commit comments

Comments
 (0)