mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-05-02 19:30:23 +01:00
Create spring-boot-sql module
Closes gh-46140
This commit is contained in:
@@ -128,6 +128,7 @@ include "spring-boot-project:spring-boot-session-data-mongodb"
|
||||
include "spring-boot-project:spring-boot-session-data-redis"
|
||||
include "spring-boot-project:spring-boot-session-hazelcast"
|
||||
include "spring-boot-project:spring-boot-session-jdbc"
|
||||
include "spring-boot-project:spring-boot-sql"
|
||||
include "spring-boot-project:spring-boot-test"
|
||||
include "spring-boot-project:spring-boot-test-autoconfigure"
|
||||
include "spring-boot-project:spring-boot-test-integration-tests"
|
||||
|
||||
-10
@@ -327,16 +327,6 @@
|
||||
"messages"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "spring.sql.init.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Whether basic script-based initialization of an SQL database is enabled.",
|
||||
"defaultValue": true,
|
||||
"deprecation": {
|
||||
"replacement": "spring.sql.init.mode",
|
||||
"level": "warning"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "spring.threads.virtual.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
|
||||
+1
-1
@@ -35,8 +35,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.sql.init.OnDatabaseInitializationCondition;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.sql.autoconfigure.init.OnDatabaseInitializationCondition;
|
||||
import org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer;
|
||||
import org.springframework.boot.transaction.autoconfigure.TransactionAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@@ -2058,6 +2058,7 @@ bom {
|
||||
"spring-boot-session-data-redis",
|
||||
"spring-boot-session-hazelcast",
|
||||
"spring-boot-session-jdbc",
|
||||
"spring-boot-sql",
|
||||
"spring-boot-starter",
|
||||
"spring-boot-starter-activemq",
|
||||
"spring-boot-starter-actuator",
|
||||
|
||||
@@ -214,6 +214,7 @@ dependencies {
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-session-data-redis", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-session-hazelcast", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-session-jdbc", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-sql", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-test-autoconfigure", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-thymeleaf", configuration: "configurationPropertiesMetadata"))
|
||||
|
||||
@@ -29,6 +29,8 @@ dependencies {
|
||||
api(project(":spring-boot-project:spring-boot"))
|
||||
api("org.springframework.integration:spring-integration-core")
|
||||
|
||||
implementation(project(":spring-boot-project:spring-boot-sql"))
|
||||
|
||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
optional(project(":spring-boot-project:spring-boot-jdbc"))
|
||||
optional(project(":spring-boot-project:spring-boot-rsocket"))
|
||||
|
||||
+1
-1
@@ -36,13 +36,13 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnThreading;
|
||||
import org.springframework.boot.autoconfigure.condition.SearchStrategy;
|
||||
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jmx.JmxProperties;
|
||||
import org.springframework.boot.autoconfigure.sql.init.OnDatabaseInitializationCondition;
|
||||
import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.thread.Threading;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.PropertyMapper;
|
||||
import org.springframework.boot.context.properties.source.MutuallyExclusiveConfigurationPropertiesException;
|
||||
import org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.autoconfigure.init.OnDatabaseInitializationCondition;
|
||||
import org.springframework.boot.task.SimpleAsyncTaskSchedulerBuilder;
|
||||
import org.springframework.boot.task.ThreadPoolTaskSchedulerBuilder;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
@@ -27,6 +27,7 @@ description = "Spring Boot JDBC"
|
||||
|
||||
dependencies {
|
||||
api(project(":spring-boot-project:spring-boot"))
|
||||
api(project(":spring-boot-project:spring-boot-sql"))
|
||||
api("org.springframework:spring-jdbc")
|
||||
|
||||
implementation(project(":spring-boot-project:spring-boot-tx"))
|
||||
@@ -46,8 +47,8 @@ dependencies {
|
||||
|
||||
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
|
||||
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
|
||||
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-sql")))
|
||||
testImplementation("com.fasterxml.jackson.core:jackson-databind")
|
||||
testImplementation("com.ibm.db2:jcc")
|
||||
testImplementation("com.microsoft.sqlserver:mssql-jdbc")
|
||||
|
||||
+2
-2
@@ -18,9 +18,9 @@ package org.springframework.boot.jdbc.autoconfigure;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.boot.autoconfigure.sql.init.ApplicationScriptDatabaseInitializer;
|
||||
import org.springframework.boot.autoconfigure.sql.init.SqlInitializationProperties;
|
||||
import org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.autoconfigure.init.ApplicationScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.autoconfigure.init.SqlInitializationProperties;
|
||||
import org.springframework.boot.sql.init.DatabaseInitializationSettings;
|
||||
|
||||
/**
|
||||
|
||||
+3
-3
@@ -22,11 +22,11 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate;
|
||||
import org.springframework.boot.autoconfigure.sql.init.ApplicationScriptDatabaseInitializer;
|
||||
import org.springframework.boot.autoconfigure.sql.init.ConditionalOnSqlInitialization;
|
||||
import org.springframework.boot.autoconfigure.sql.init.SqlInitializationProperties;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||
import org.springframework.boot.sql.autoconfigure.init.ApplicationScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.autoconfigure.init.ConditionalOnSqlInitialization;
|
||||
import org.springframework.boot.sql.autoconfigure.init.SqlInitializationProperties;
|
||||
import org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
+1
-1
@@ -23,8 +23,8 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.autoconfigure.sql.init.ApplicationScriptDatabaseInitializer;
|
||||
import org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.autoconfigure.init.ApplicationScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.init.DatabaseInitializationSettings;
|
||||
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
|
||||
|
||||
@@ -30,6 +30,8 @@ dependencies {
|
||||
api("org.quartz-scheduler:quartz")
|
||||
api("org.springframework:spring-context-support")
|
||||
|
||||
implementation(project(":spring-boot-project:spring-boot-sql"))
|
||||
|
||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
optional(project(":spring-boot-project:spring-boot-jdbc"))
|
||||
optional(project(":spring-boot-project:spring-boot-jpa"))
|
||||
|
||||
+1
-1
@@ -33,8 +33,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate;
|
||||
import org.springframework.boot.autoconfigure.sql.init.OnDatabaseInitializationCondition;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.sql.autoconfigure.init.OnDatabaseInitializationCondition;
|
||||
import org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@@ -28,6 +28,7 @@ description = "Spring Boot R2DBC"
|
||||
|
||||
dependencies {
|
||||
api(project(":spring-boot-project:spring-boot"))
|
||||
api(project(":spring-boot-project:spring-boot-sql"))
|
||||
api(project(":spring-boot-project:spring-boot-tx"))
|
||||
api("org.springframework:spring-r2dbc")
|
||||
|
||||
@@ -40,7 +41,7 @@ dependencies {
|
||||
testImplementation(project(":spring-boot-project:spring-boot-jdbc"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
|
||||
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-sql")))
|
||||
testImplementation("io.projectreactor:reactor-test")
|
||||
testImplementation("io.r2dbc:r2dbc-h2")
|
||||
testImplementation("org.postgresql:r2dbc-postgresql")
|
||||
|
||||
+2
-2
@@ -18,9 +18,9 @@ package org.springframework.boot.r2dbc.autoconfigure;
|
||||
|
||||
import io.r2dbc.spi.ConnectionFactory;
|
||||
|
||||
import org.springframework.boot.autoconfigure.sql.init.ApplicationScriptDatabaseInitializer;
|
||||
import org.springframework.boot.autoconfigure.sql.init.SqlInitializationProperties;
|
||||
import org.springframework.boot.r2dbc.init.R2dbcScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.autoconfigure.init.ApplicationScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.autoconfigure.init.SqlInitializationProperties;
|
||||
import org.springframework.boot.sql.init.DatabaseInitializationSettings;
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -22,10 +22,10 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate;
|
||||
import org.springframework.boot.autoconfigure.sql.init.ConditionalOnSqlInitialization;
|
||||
import org.springframework.boot.autoconfigure.sql.init.SqlInitializationProperties;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.r2dbc.ConnectionFactoryBuilder;
|
||||
import org.springframework.boot.sql.autoconfigure.init.ConditionalOnSqlInitialization;
|
||||
import org.springframework.boot.sql.autoconfigure.init.SqlInitializationProperties;
|
||||
import org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
+1
-1
@@ -22,8 +22,8 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.autoconfigure.sql.init.ApplicationScriptDatabaseInitializer;
|
||||
import org.springframework.boot.r2dbc.init.R2dbcScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.autoconfigure.init.ApplicationScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.init.DatabaseInitializationSettings;
|
||||
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
|
||||
|
||||
+1
-1
@@ -26,12 +26,12 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
|
||||
import org.springframework.boot.autoconfigure.sql.init.OnDatabaseInitializationCondition;
|
||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.PropertyMapper;
|
||||
import org.springframework.boot.session.autoconfigure.SessionAutoConfiguration;
|
||||
import org.springframework.boot.session.autoconfigure.SessionProperties;
|
||||
import org.springframework.boot.sql.autoconfigure.init.OnDatabaseInitializationCondition;
|
||||
import org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Conditional;
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License);
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
plugins {
|
||||
id "java-library"
|
||||
id "java-test-fixtures"
|
||||
id "org.springframework.boot.configuration-properties"
|
||||
id "org.springframework.boot.deployed"
|
||||
id "org.springframework.boot.optional-dependencies"
|
||||
}
|
||||
|
||||
description = "Spring Boot SQL"
|
||||
|
||||
dependencies {
|
||||
api(project(":spring-boot-project:spring-boot"))
|
||||
|
||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
|
||||
testFixturesImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testFixturesImplementation("org.springframework:spring-tx")
|
||||
|
||||
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
|
||||
testRuntimeOnly("ch.qos.logback:logback-classic")
|
||||
}
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.sql.init;
|
||||
package org.springframework.boot.sql.autoconfigure.init;
|
||||
|
||||
import org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer;
|
||||
import org.springframework.boot.sql.init.DatabaseInitializationSettings;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.sql.init;
|
||||
package org.springframework.boot.sql.autoconfigure.init;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.sql.init;
|
||||
package org.springframework.boot.sql.autoconfigure.init;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.sql.init;
|
||||
package org.springframework.boot.sql.autoconfigure.init;
|
||||
|
||||
import org.springframework.context.annotation.Condition;
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.sql.init;
|
||||
package org.springframework.boot.sql.autoconfigure.init;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.sql.init;
|
||||
package org.springframework.boot.sql.autoconfigure.init;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.List;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.sql.init;
|
||||
package org.springframework.boot.sql.autoconfigure.init;
|
||||
|
||||
import org.springframework.aot.hint.RuntimeHints;
|
||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||
+1
-1
@@ -17,4 +17,4 @@
|
||||
/**
|
||||
* Auto-configuration for basic script-based initialization of an SQL database.
|
||||
*/
|
||||
package org.springframework.boot.autoconfigure.sql.init;
|
||||
package org.springframework.boot.sql.autoconfigure.init;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"properties": [
|
||||
{
|
||||
"name": "spring.sql.init.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Whether basic script-based initialization of an SQL database is enabled.",
|
||||
"defaultValue": true,
|
||||
"deprecation": {
|
||||
"replacement": "spring.sql.init.mode",
|
||||
"level": "warning"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
# Depends On Database Initialization Detectors
|
||||
org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector=\
|
||||
org.springframework.boot.sql.init.dependency.AnnotationDependsOnDatabaseInitializationDetector
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.sql.init;
|
||||
package org.springframework.boot.sql.autoconfigure.init;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.sql.init;
|
||||
package org.springframework.boot.sql.autoconfigure.init;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
Reference in New Issue
Block a user