mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Add `DevToolsR2dbcAutoConfiguration` to automatically shutdown in-memory R2DBC databases before restarting. Prior to this commit, restarts that involved SQL initialization scripts could fail due to dirty database content. The `DevToolsR2dbcAutoConfiguration` class is similar in design to `DevToolsDataSourceAutoConfiguration`, but it applies to both pooled and non-pooled connection factories. The `DataSource` variant does not need to deal with non-pooled connections due to the fact that `EmbeddedDataSourceConfiguration` calls `EmbeddedDatabase.shutdown` as a `destroyMethod`. With R2DB we don't have an `EmbeddedDatabase` equivalent so we can always trigger a shutdown for devtools. Fixes gh-28345
91 lines
3.5 KiB
Groovy
91 lines
3.5 KiB
Groovy
plugins {
|
|
id "java-library"
|
|
id "org.springframework.boot.auto-configuration"
|
|
id "org.springframework.boot.conventions"
|
|
id "org.springframework.boot.deployed"
|
|
id "org.springframework.boot.integration-test"
|
|
id "org.springframework.boot.optional-dependencies"
|
|
}
|
|
|
|
description = "Spring Boot Developer Tools"
|
|
|
|
configurations {
|
|
intTestDependencies {
|
|
extendsFrom dependencyManagement
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
api(project(":spring-boot-project:spring-boot"))
|
|
api(project(":spring-boot-project:spring-boot-autoconfigure"))
|
|
|
|
intTestDependencies(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web"))
|
|
|
|
intTestImplementation(project(":spring-boot-project:spring-boot-autoconfigure"))
|
|
intTestImplementation(project(":spring-boot-project:spring-boot-test"))
|
|
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
|
intTestImplementation("org.apache.httpcomponents:httpclient")
|
|
intTestImplementation("org.assertj:assertj-core")
|
|
intTestImplementation("org.awaitility:awaitility")
|
|
intTestImplementation("org.junit.jupiter:junit-jupiter")
|
|
intTestImplementation("net.bytebuddy:byte-buddy")
|
|
|
|
intTestRuntimeOnly("org.springframework:spring-web")
|
|
|
|
optional("io.projectreactor:reactor-core")
|
|
optional("io.r2dbc:r2dbc-spi")
|
|
optional("javax.servlet:javax.servlet-api")
|
|
optional("org.apache.derby:derby")
|
|
optional("org.hibernate:hibernate-core")
|
|
optional("org.springframework:spring-jdbc")
|
|
optional("org.springframework:spring-orm")
|
|
optional("org.springframework:spring-web")
|
|
optional("org.springframework.security:spring-security-config")
|
|
optional("org.springframework.security:spring-security-web")
|
|
optional("org.springframework.data:spring-data-redis")
|
|
optional("org.springframework.session:spring-session-core")
|
|
|
|
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
|
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
|
testImplementation("ch.qos.logback:logback-classic")
|
|
testImplementation("com.h2database:h2")
|
|
testImplementation("com.zaxxer:HikariCP")
|
|
testImplementation("org.apache.derby:derbyclient")
|
|
testImplementation("org.apache.tomcat.embed:tomcat-embed-websocket")
|
|
testImplementation("org.apache.tomcat.embed:tomcat-embed-core")
|
|
testImplementation("org.apache.tomcat.embed:tomcat-embed-jasper")
|
|
testImplementation("org.assertj:assertj-core")
|
|
testImplementation("org.awaitility:awaitility")
|
|
testImplementation("org.eclipse.jetty.websocket:websocket-client")
|
|
testImplementation("org.hamcrest:hamcrest-library")
|
|
testImplementation("org.hsqldb:hsqldb")
|
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
|
testImplementation("org.mockito:mockito-core")
|
|
testImplementation("org.mockito:mockito-junit-jupiter")
|
|
testImplementation("org.postgresql:postgresql")
|
|
testImplementation("org.springframework:spring-test")
|
|
testImplementation("org.springframework:spring-webmvc")
|
|
testImplementation("org.springframework:spring-websocket")
|
|
testImplementation("org.springframework.hateoas:spring-hateoas")
|
|
testImplementation("org.springframework.security:spring-security-test")
|
|
testImplementation("org.thymeleaf:thymeleaf")
|
|
testImplementation("org.thymeleaf:thymeleaf-spring5")
|
|
testImplementation("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect")
|
|
|
|
testRuntimeOnly("org.aspectj:aspectjweaver")
|
|
testRuntimeOnly("org.yaml:snakeyaml")
|
|
testRuntimeOnly("io.r2dbc:r2dbc-h2")
|
|
}
|
|
|
|
task syncIntTestDependencies(type: Sync) {
|
|
destinationDir = file("${buildDir}/dependencies")
|
|
from {
|
|
configurations.intTestDependencies
|
|
}
|
|
from jar
|
|
}
|
|
|
|
intTest {
|
|
dependsOn syncIntTestDependencies
|
|
}
|