Skip to content

Commit 85f1e2c

Browse files
committed
Refactor DataSourceBuilder and add derivedFrom
Refactor `DataSourceBuilder` to use direct property mappers rather than the `Binder` and aliases. Supported DataSource types now include two-way mappers which allows us to both get and set properties in a uniform way. A new `derivedFrom` factory method has been added which allows a new `DataSource` to be derived from an existing one. This update is primarily to allow Flyway and Liquibase migrations to work against a `@Bean` configured DataSource rather than assuming that the primary DataSource was always created via auto-configuration. See gh-25643
1 parent 6e92daa commit 85f1e2c

File tree

5 files changed

+820
-172
lines changed

5 files changed

+820
-172
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ dependencies {
2020
optional("com.atomikos:transactions-jms")
2121
optional("com.atomikos:transactions-jta")
2222
optional("com.fasterxml.jackson.core:jackson-databind")
23+
optional("com.h2database:h2")
2324
optional("com.google.code.gson:gson")
2425
optional("com.oracle.database.jdbc:ucp")
26+
optional("com.oracle.database.jdbc:ojdbc8")
2527
optional("com.samskivert:jmustache")
2628
optional("com.zaxxer:HikariCP")
2729
optional("io.netty:netty-tcnative-boringssl-static")
@@ -58,6 +60,7 @@ dependencies {
5860
optional("org.jboss:jboss-transaction-spi")
5961
optional("org.jooq:jooq")
6062
optional("org.liquibase:liquibase-core")
63+
optional("org.postgresql:postgresql")
6164
optional("org.slf4j:jul-to-slf4j")
6265
optional("org.slf4j:slf4j-api")
6366
optional("org.springframework:spring-messaging")
@@ -76,11 +79,9 @@ dependencies {
7679

7780
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
7881
testImplementation("com.google.appengine:appengine-api-1.0-sdk")
79-
testImplementation("com.h2database:h2")
8082
testImplementation("com.ibm.db2:jcc")
8183
testImplementation("com.jayway.jsonpath:json-path")
8284
testImplementation("com.microsoft.sqlserver:mssql-jdbc")
83-
testImplementation("com.oracle.database.jdbc:ojdbc8")
8485
testImplementation("com.squareup.okhttp3:okhttp")
8586
testImplementation("com.sun.xml.messaging.saaj:saaj-impl")
8687
testImplementation("io.projectreactor:reactor-test")
@@ -97,7 +98,6 @@ dependencies {
9798
testImplementation("org.mariadb.jdbc:mariadb-java-client")
9899
testImplementation("org.mockito:mockito-core")
99100
testImplementation("org.mockito:mockito-junit-jupiter")
100-
testImplementation("org.postgresql:postgresql")
101101
testImplementation("org.springframework:spring-context-support")
102102
testImplementation("org.springframework.data:spring-data-redis")
103103
testImplementation("org.springframework.data:spring-data-r2dbc")

0 commit comments

Comments
 (0)