Skip to content

Commit c8db8e8

Browse files
Improve spring integration deps (#484)
* Make dependencies of `sdk-spring-boot` minimal, and make sure all the deps used by the starter modules are what people need to get started.
1 parent c3f43be commit c8db8e8

File tree

4 files changed

+49
-49
lines changed

4 files changed

+49
-49
lines changed

gradle/libs.versions.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ vertx = "4.5.11"
88
kotlinx-serialization = "1.7.3"
99
kotlinx-coroutines = "1.9.0"
1010
junit = "5.10.2"
11-
spring-boot = "3.4.0"
11+
spring-boot = "3.4.4"
1212
log4j = "2.24.2"
1313
restate = "2.0.0-SNAPSHOT"
1414

@@ -48,7 +48,9 @@ jspecify = "org.jspecify:jspecify:1.0.0"
4848
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
4949
junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
5050
slf4j-nop = "org.slf4j:slf4j-nop:2.0.16"
51+
spring-boot = { module = "org.springframework.boot:spring-boot", version.ref = "spring-boot" }
5152
spring-boot-starter = { module = "org.springframework.boot:spring-boot-starter", version.ref = "spring-boot" }
53+
spring-boot-starter-logging = { module = "org.springframework.boot:spring-boot-starter-logging", version.ref = "spring-boot" }
5254
spring-boot-starter-json = { module = "org.springframework.boot:spring-boot-starter-json", version.ref = "spring-boot" }
5355
spring-boot-starter-test = { module = "org.springframework.boot:spring-boot-starter-test", version.ref = "spring-boot" }
5456
testcontainers = "org.testcontainers:testcontainers:1.20.4"

sdk-spring-boot-kotlin-starter/build.gradle.kts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,21 @@ description = "Restate SDK Spring Boot Kotlin starter"
1010
dependencies {
1111
compileOnly(libs.jspecify)
1212

13+
// SDK dependencies
1314
api(project(":sdk-api-kotlin"))
1415
api(project(":client-kotlin"))
16+
api(project(":sdk-serde-kotlinx"))
1517
api(project(":sdk-spring-boot"))
1618

19+
// Spring boot starter for kotlin dependencies brought in here for convenience
20+
api(libs.spring.boot.starter)
21+
implementation("org.jetbrains.kotlin:kotlin-reflect")
22+
23+
// Testing
1724
kspTest(project(":sdk-api-kotlin-gen"))
1825
testImplementation(project(":sdk-testing"))
1926
testImplementation(libs.kotlinx.coroutines.test)
2027
testImplementation(libs.spring.boot.starter.test)
21-
22-
// We need these for the deployment manifest
2328
testImplementation(project(":sdk-core"))
2429
testImplementation(libs.jackson.annotations)
2530
testImplementation(libs.jackson.databind)

sdk-spring-boot-starter/build.gradle.kts

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,32 @@ description = "Restate SDK Spring Boot starter"
1010
dependencies {
1111
compileOnly(libs.jspecify)
1212

13+
val excludeJackson =
14+
fun ProjectDependency.() {
15+
// Let spring bring jackson in
16+
exclude(group = "com.fasterxml.jackson")
17+
exclude(group = "com.fasterxml.jackson.core")
18+
exclude(group = "com.fasterxml.jackson.datatype")
19+
}
20+
21+
// SDK dependencies
1322
api(project(":sdk-spring-boot"))
14-
api(project(":sdk-api")) {
15-
// Let spring bring jackson in
16-
exclude(group = "com.fasterxml.jackson")
17-
exclude(group = "com.fasterxml.jackson.core")
18-
exclude(group = "com.fasterxml.jackson.datatype")
19-
}
20-
api(project(":client")) {
21-
// Let spring bring jackson in
22-
exclude(group = "com.fasterxml.jackson")
23-
exclude(group = "com.fasterxml.jackson.core")
24-
exclude(group = "com.fasterxml.jackson.datatype")
25-
}
26-
api(project(":sdk-serde-jackson")) {
27-
// Let spring bring jackson in
28-
exclude(group = "com.fasterxml.jackson")
29-
exclude(group = "com.fasterxml.jackson.core")
30-
exclude(group = "com.fasterxml.jackson.datatype")
31-
}
23+
api(project(":sdk-api"), excludeJackson)
24+
api(project(":client"), excludeJackson)
25+
api(project(":sdk-serde-jackson"), excludeJackson)
26+
27+
// Spring boot starter brought in here for convenience
28+
api(libs.spring.boot.starter)
3229

30+
// Testing
31+
testImplementation(libs.spring.boot.starter.test)
32+
testAnnotationProcessor(project(":sdk-api-gen"))
3333
// We need these for the deployment manifest
3434
testImplementation(project(":sdk-core"))
3535
testImplementation(libs.jackson.annotations)
3636
testImplementation(libs.jackson.databind)
37-
38-
testAnnotationProcessor(project(":sdk-api-gen"))
3937
testImplementation(project(":sdk-serde-jackson"))
4038
testImplementation(project(":sdk-testing"))
41-
42-
testImplementation(libs.spring.boot.starter.test)
4339
}
4440

4541
tasks.withType<JavaCompile> { options.compilerArgs.add("-parameters") }

sdk-spring-boot/build.gradle.kts

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,37 @@ description = "Restate SDK Spring Boot integration"
1010
dependencies {
1111
compileOnly(libs.jspecify)
1212

13-
api(project(":sdk-common")) {
14-
// Let spring bring jackson in
15-
exclude(group = "com.fasterxml.jackson")
16-
exclude(group = "com.fasterxml.jackson.core")
17-
exclude(group = "com.fasterxml.jackson.datatype")
18-
}
19-
20-
api(project(":client")) {
21-
// Let spring bring jackson in
22-
exclude(group = "com.fasterxml.jackson")
23-
exclude(group = "com.fasterxml.jackson.core")
24-
exclude(group = "com.fasterxml.jackson.datatype")
25-
}
26-
27-
implementation(project(":sdk-http-vertx")) {
28-
// Let spring bring jackson in
29-
exclude(group = "com.fasterxml.jackson")
30-
exclude(group = "com.fasterxml.jackson.core")
31-
exclude(group = "com.fasterxml.jackson.datatype")
32-
}
33-
implementation(project(":sdk-request-identity"))
13+
val excludeJackson =
14+
fun ProjectDependency.() {
15+
// Let spring bring jackson in
16+
exclude(group = "com.fasterxml.jackson")
17+
exclude(group = "com.fasterxml.jackson.core")
18+
exclude(group = "com.fasterxml.jackson.datatype")
19+
}
20+
21+
// SDK deps
22+
implementation(project(":sdk-common"), excludeJackson)
23+
implementation(project(":client"), excludeJackson)
24+
implementation(project(":sdk-http-vertx"), excludeJackson)
25+
implementation(project(":sdk-request-identity"), excludeJackson)
3426
implementation(libs.vertx.core) {
3527
// Let spring bring jackson in
3628
exclude(group = "com.fasterxml.jackson")
3729
exclude(group = "com.fasterxml.jackson.core")
3830
exclude(group = "com.fasterxml.jackson.datatype")
3931
}
4032

41-
implementation(libs.spring.boot.starter)
42-
43-
// Spring is going to bring jackson in with this
33+
implementation(libs.spring.boot)
34+
implementation(libs.spring.boot.starter.logging)
35+
// In principle kotlin won't need this, but it's needed by the SDK core anyway, so we just import
36+
// this in.
4437
implementation(libs.spring.boot.starter.json)
4538

39+
testImplementation(libs.spring.boot.starter)
40+
testImplementation(libs.spring.boot.starter.json)
4641
testImplementation(libs.spring.boot.starter.test)
4742
}
4843

4944
tasks.withType<JavaCompile> { options.compilerArgs.add("-parameters") }
45+
46+
tasks.withType<Javadoc> { isFailOnError = false }

0 commit comments

Comments
 (0)