Skip to content

Commit 0385b08

Browse files
committed
Create spring-boot-jooq module
1 parent ab040c9 commit 0385b08

File tree

35 files changed

+80
-46
lines changed

35 files changed

+80
-46
lines changed

settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ include "spring-boot-project:spring-boot-jackson"
6363
include "spring-boot-project:spring-boot-jdbc"
6464
include "spring-boot-project:spring-boot-jetty"
6565
include "spring-boot-project:spring-boot-jms"
66+
include "spring-boot-project:spring-boot-jooq"
6667
include "spring-boot-project:spring-boot-jpa"
6768
include "spring-boot-project:spring-boot-jsonb"
6869
include "spring-boot-project:spring-boot-kafka"
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
# Environment Post Processors
22
org.springframework.boot.env.EnvironmentPostProcessor=\
33
org.springframework.boot.reactor.ReactorEnvironmentPostProcessor
4-
5-
# Depends On Database Initialization Detectors
6-
org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector=\
7-
org.springframework.boot.jooq.JooqDependsOnDatabaseInitializationDetector

spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring.factories

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ org.springframework.boot.autoconfigure.http.MessageConverterBackgroundPreinitial
44

55
# Failure Analyzers
66
org.springframework.boot.diagnostics.FailureAnalyzer=\
7-
org.springframework.boot.autoconfigure.data.redis.RedisUrlSyntaxFailureAnalyzer,\
8-
org.springframework.boot.autoconfigure.jooq.JaxbNotAvailableExceptionFailureAnalyzer,\
9-
org.springframework.boot.autoconfigure.jooq.NoDslContextBeanFailureAnalyzer
7+
org.springframework.boot.autoconfigure.data.redis.RedisUrlSyntaxFailureAnalyzer
108

119
# Template Availability Providers
1210
org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider=\

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

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfigurati
4949
org.springframework.boot.autoconfigure.http.client.HttpClientAutoConfiguration
5050
org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration
5151
org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration
52-
org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration
5352
org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration
5453
org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration
5554
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration

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

+1
Original file line numberDiff line numberDiff line change
@@ -2043,6 +2043,7 @@ bom {
20432043
"spring-boot-jdbc",
20442044
"spring-boot-jetty",
20452045
"spring-boot-jms",
2046+
"spring-boot-jooq",
20462047
"spring-boot-jpa",
20472048
"spring-boot-jsonb",
20482049
"spring-boot-kafka",

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

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ dependencies {
6868
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jdbc", configuration: "autoConfigurationMetadata"))
6969
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "autoConfigurationMetadata"))
7070
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jms", configuration: "autoConfigurationMetadata"))
71+
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jooq", configuration: "autoConfigurationMetadata"))
7172
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jpa", configuration: "autoConfigurationMetadata"))
7273
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jsonb", configuration: "autoConfigurationMetadata"))
7374
autoConfiguration(project(path: ":spring-boot-project:spring-boot-kafka", configuration: "autoConfigurationMetadata"))
@@ -102,6 +103,7 @@ dependencies {
102103
configurationProperties(project(path: ":spring-boot-project:spring-boot-integration", configuration: "configurationPropertiesMetadata"))
103104
configurationProperties(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "configurationPropertiesMetadata"))
104105
configurationProperties(project(path: ":spring-boot-project:spring-boot-jdbc", configuration: "configurationPropertiesMetadata"))
106+
configurationProperties(project(path: ":spring-boot-project:spring-boot-jooq", configuration: "configurationPropertiesMetadata"))
105107
configurationProperties(project(path: ":spring-boot-project:spring-boot-jpa", configuration: "configurationPropertiesMetadata"))
106108
configurationProperties(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "configurationPropertiesMetadata"))
107109
configurationProperties(project(path: ":spring-boot-project:spring-boot-jms", configuration: "configurationPropertiesMetadata"))

spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/data-access.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -403,4 +403,4 @@ include-code::ElasticsearchEntityManagerFactoryDependsOnPostProcessor[]
403403
If you need to use jOOQ with multiple data sources, you should create your own javadoc:org.jooq.DSLContext[] for each one.
404404
See {code-spring-boot-autoconfigure-src}/jooq/JooqAutoConfiguration.java[`JooqAutoConfiguration`] for more details.
405405

406-
TIP: In particular, javadoc:org.springframework.boot.autoconfigure.jooq.ExceptionTranslatorExecuteListener[] and javadoc:org.springframework.boot.autoconfigure.jooq.SpringTransactionProvider[] can be reused to provide similar features to what the auto-configuration does with a single javadoc:javax.sql.DataSource[].
406+
TIP: In particular, javadoc:org.springframework.boot.jooq.autoconfigure.ExceptionTranslatorExecuteListener[] and javadoc:org.springframework.boot.jooq.autoconfigure.SpringTransactionProvider[] can be reused to provide similar features to what the auto-configuration does with a single javadoc:javax.sql.DataSource[].

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/data/sql.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ NOTE: Spring Boot can only auto-configure dialects supported by the open source
457457
[[data.sql.jooq.customizing]]
458458
=== Customizing jOOQ
459459

460-
More advanced customizations can be achieved by defining your own javadoc:org.springframework.boot.autoconfigure.jooq.DefaultConfigurationCustomizer[] bean that will be invoked prior to creating the javadoc:org.jooq.Configuration[] javadoc:org.springframework.context.annotation.Bean[format=annotation].
460+
More advanced customizations can be achieved by defining your own javadoc:org.springframework.boot.jooq.autoconfigure.DefaultConfigurationCustomizer[] bean that will be invoked prior to creating the javadoc:org.jooq.Configuration[] javadoc:org.springframework.context.annotation.Bean[format=annotation].
461461
This takes precedence to anything that is applied by the auto-configuration.
462462

463463
You can also create your own javadoc:org.jooq.Configuration[] javadoc:org.springframework.context.annotation.Bean[format=annotation] if you want to take complete control of the jOOQ configuration.

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ dependencies {
1818
optional("org.flywaydb:flyway-database-postgresql")
1919
optional("org.flywaydb:flyway-sqlserver")
2020

21+
testImplementation(project(":spring-boot-project:spring-boot-jooq"))
2122
testImplementation(project(":spring-boot-project:spring-boot-test"))
2223
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
2324
testImplementation("jakarta.persistence:jakarta.persistence-api")
2425
testImplementation("org.hibernate.orm:hibernate-core")
2526
testImplementation("org.hsqldb:hsqldb")
26-
testImplementation("org.jooq:jooq") {
27-
exclude group: "javax.xml.bind", module: "jaxb-api"
28-
}
2927
testImplementation("org.postgresql:postgresql")
3028
testImplementation("org.springframework:spring-orm")
3129

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 jOOQ"
10+
11+
dependencies {
12+
api(project(":spring-boot-project:spring-boot-jdbc"))
13+
api(project(":spring-boot-project:spring-boot-tx"))
14+
api("org.jooq:jooq")
15+
16+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
17+
optional(project(":spring-boot-project:spring-boot-r2dbc"))
18+
optional("jakarta.xml.bind:jakarta.xml.bind-api")
19+
20+
testImplementation(project(":spring-boot-project:spring-boot-test"))
21+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
22+
23+
testRuntimeOnly("ch.qos.logback:logback-classic")
24+
testRuntimeOnly("com.h2database:h2")
25+
testRuntimeOnly("com.zaxxer:HikariCP")
26+
testRuntimeOnly("io.r2dbc:r2dbc-h2")
27+
testRuntimeOnly("org.glassfish.jaxb:jaxb-runtime")
28+
testRuntimeOnly("org.hsqldb:hsqldb")
29+
}
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.
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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import org.jooq.impl.DefaultConfiguration;
2020

@@ -23,7 +23,7 @@
2323
* {@link DefaultConfiguration} whilst retaining default auto-configuration.
2424
*
2525
* @author Stephane Nicoll
26-
* @since 2.5.0
26+
* @since 4.0.0
2727
*/
2828
@FunctionalInterface
2929
public interface DefaultConfigurationCustomizer {
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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import java.sql.SQLException;
2020
import java.util.function.Function;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import java.sql.SQLException;
2020
import java.util.function.Function;
@@ -34,7 +34,7 @@
3434
* adapting an existing {@link SQLExceptionTranslator}.
3535
*
3636
* @author Dennis Melzer
37-
* @since 3.3.0
37+
* @since 4.0.0
3838
* @see #DEFAULT
3939
* @see #of(Function)
4040
*/
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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
/**
2020
* Exception to be thrown if JAXB is not available.
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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import org.springframework.boot.diagnostics.AbstractFailureAnalyzer;
2020
import org.springframework.boot.diagnostics.FailureAnalysis;
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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import java.io.IOException;
2020
import java.io.InputStream;
@@ -68,7 +68,7 @@
6868
* @author Michael Simons
6969
* @author Dmytro Nosan
7070
* @author Moritz Halbritter
71-
* @since 1.3.0
71+
* @since 4.0.0
7272
*/
7373
@AutoConfiguration(after = { DataSourceAutoConfiguration.class, TransactionAutoConfiguration.class })
7474
@ConditionalOnClass(DSLContext.class)
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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import javax.sql.DataSource;
2020

@@ -29,7 +29,7 @@
2929
* @author Andreas Ahlenstorf
3030
* @author Michael Simons
3131
* @author Moritz Halbritter
32-
* @since 1.3.0
32+
* @since 4.0.0
3333
*/
3434
@ConfigurationProperties("spring.jooq")
3535
public class JooqProperties {
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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import org.jooq.DSLContext;
2020

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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import org.jooq.Transaction;
2020

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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import org.jooq.TransactionContext;
2020
import org.jooq.TransactionProvider;
@@ -30,7 +30,7 @@
3030
* @author Lukas Eder
3131
* @author Andreas Ahlenstorf
3232
* @author Phillip Webb
33-
* @since 1.5.10
33+
* @since 4.0.0
3434
*/
3535
public class SpringTransactionProvider implements TransactionProvider {
3636

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import java.sql.Connection;
2020
import java.sql.SQLException;
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
/**
1818
* Auto-configuration for jOOQ.
1919
*/
20-
package org.springframework.boot.autoconfigure.jooq;
20+
package org.springframework.boot.jooq.autoconfigure;

spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/jooq/package-info.java renamed to spring-boot-project/spring-boot-jooq/src/main/java/org/springframework/boot/jooq/package-info.java

+1-1
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.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Failure Analyzers
2+
org.springframework.boot.diagnostics.FailureAnalyzer=\
3+
org.springframework.boot.jooq.autoconfigure.JaxbNotAvailableExceptionFailureAnalyzer,\
4+
org.springframework.boot.jooq.autoconfigure.NoDslContextBeanFailureAnalyzer
5+
6+
# Depends On Database Initialization Detectors
7+
org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector=\
8+
org.springframework.boot.jooq.JooqDependsOnDatabaseInitializationDetector
9+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.springframework.boot.jooq.autoconfigure.JooqAutoConfiguration
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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import java.sql.SQLException;
2020
import java.util.function.Function;
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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import javax.sql.DataSource;
2020

@@ -227,7 +227,7 @@ void autoConfiguredJooqConfigurationCanBeUsedToCreateCustomDslContext() {
227227
@Test
228228
void shouldLoadSettingsFromConfigPropertyThroughJaxb() {
229229
this.contextRunner.withUserConfiguration(JooqDataSourceConfiguration.class)
230-
.withPropertyValues("spring.jooq.config=classpath:org/springframework/boot/autoconfigure/jooq/settings.xml")
230+
.withPropertyValues("spring.jooq.config=classpath:org/springframework/boot/jooq/autoconfigure/settings.xml")
231231
.run((context) -> {
232232
assertThat(context).hasSingleBean(Settings.class);
233233
Settings settings = context.getBean(Settings.class);
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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import java.sql.Connection;
2020
import java.sql.DatabaseMetaData;
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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import org.jooq.DSLContext;
2020
import org.junit.jupiter.api.Test;
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.jooq;
17+
package org.springframework.boot.jooq.autoconfigure;
1818

1919
import java.sql.Connection;
2020
import java.sql.DatabaseMetaData;

spring-boot-project/spring-boot-starters/spring-boot-starter-jooq/build.gradle

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ description = "Starter for using jOOQ to access SQL databases with JDBC. An alte
66

77
dependencies {
88
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc"))
9-
api(project(":spring-boot-project:spring-boot-tx"))
10-
api("org.jooq:jooq")
9+
api(project(":spring-boot-project:spring-boot-jooq"))
1110
}

0 commit comments

Comments
 (0)