Skip to content

Commit 7011199

Browse files
Use mavenLocal for temporal-spring-ai instead of composite build
Replace the includeBuild('../sdk-java') dependency-substitution block with a plain mavenLocal() repository and a pinned 1.35.0-SNAPSHOT coordinate for the springai* samples. Build temporal-spring-ai locally with `./gradlew publishToMavenLocal` in an sdk-java checkout and the samples pick it up via mavenLocal — no composite build, no SDK-wide substitution. A nice side-effect: the core module no longer has a newer grpc forced onto its classpath, so the SSL sample's gRPC workarounds (explicit grpc-util dep + updateIdentityCredentials switch) are no longer needed. Revert them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent df3ec0e commit 7011199

5 files changed

Lines changed: 18 additions & 28 deletions

File tree

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ subprojects {
3232
}
3333

3434
repositories {
35+
// mavenLocal() is needed for the springai* samples to pick up the
36+
// unreleased temporal-spring-ai SNAPSHOT built from a local sdk-java
37+
// checkout (see gradle/springai.gradle). Remove once temporal-spring-ai
38+
// is published to Maven Central.
39+
mavenLocal()
3540
maven {
3641
url "https://oss.sonatype.org/content/repositories/snapshots/"
3742
}

core/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ dependencies {
77
// Environment configuration
88
implementation "io.temporal:temporal-envconfig:$javaSDKVersion"
99

10-
// AdvancedTlsX509KeyManager used by the SSL sample. Pinned explicitly so this
11-
// module resolves it regardless of the SDK's transitive grpc version (needed
12-
// in particular when substituting the SDK via composite build).
13-
implementation "io.grpc:grpc-util:1.75.0"
14-
1510
// Needed for SDK related functionality
1611
implementation(platform("com.fasterxml.jackson:jackson-bom:2.17.2"))
1712
implementation "com.fasterxml.jackson.core:jackson-databind"

core/src/main/java/io/temporal/samples/ssl/Starter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public static void main(String[] args) throws Exception {
5050
if (refreshPeriod > 0) {
5151
AdvancedTlsX509KeyManager clientKeyManager = new AdvancedTlsX509KeyManager();
5252
// Reload credentials every minute
53-
clientKeyManager.updateIdentityCredentials(
54-
clientCertFile,
53+
clientKeyManager.updateIdentityCredentialsFromFile(
5554
clientKeyFile,
55+
clientCertFile,
5656
refreshPeriod,
5757
TimeUnit.MINUTES,
5858
Executors.newScheduledThreadPool(1));

gradle/springai.gradle

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ apply plugin: 'io.spring.dependency-management'
77
ext {
88
springBootVersionForSpringAi = '3.5.3'
99
springAiVersion = '1.1.0'
10+
// temporal-spring-ai isn't on Maven Central yet. Build it locally from
11+
// sdk-java master (`./gradlew publishToMavenLocal`) and the springai*
12+
// samples will pick it up via mavenLocal(). Until release, pin this to
13+
// whatever version sdk-java master is publishing (1.35.0-SNAPSHOT today).
14+
springAiSdkVersion = '1.35.0-SNAPSHOT'
1015
}
1116

1217
java {
@@ -22,9 +27,12 @@ dependencyManagement {
2227
}
2328

2429
dependencies {
25-
// Temporal
26-
implementation "io.temporal:temporal-spring-boot-starter:$javaSDKVersion"
27-
implementation "io.temporal:temporal-spring-ai:$javaSDKVersion"
30+
// Temporal — pinned to springAiSdkVersion (see comment above) because
31+
// temporal-spring-ai requires an SDK newer than $javaSDKVersion.
32+
implementation "io.temporal:temporal-spring-boot-starter:$springAiSdkVersion"
33+
implementation "io.temporal:temporal-spring-ai:$springAiSdkVersion"
34+
// temporal-spring-ai declares temporal-sdk as compileOnly, so bring it in explicitly.
35+
implementation "io.temporal:temporal-sdk:$springAiSdkVersion"
2836

2937
// Spring Boot
3038
implementation 'org.springframework.boot:spring-boot-starter'

settings.gradle

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,3 @@ include 'springai-rag'
77
include 'springboot'
88
include 'springboot-basic'
99

10-
// Include local sdk-java build for temporal-spring-ai (until published to Maven Central).
11-
// temporal-spring-ai is not yet in a released SDK, so we substitute all SDK modules from the
12-
// local build when the sibling ../sdk-java checkout is available. Without the checkout, the
13-
// springai* modules will fail to resolve io.temporal:temporal-spring-ai — that's expected
14-
// until the artifact is published.
15-
if (file('../sdk-java').exists()) {
16-
includeBuild('../sdk-java') {
17-
dependencySubstitution {
18-
substitute module('io.temporal:temporal-spring-ai') using project(':temporal-spring-ai')
19-
substitute module('io.temporal:temporal-sdk') using project(':temporal-sdk')
20-
substitute module('io.temporal:temporal-serviceclient') using project(':temporal-serviceclient')
21-
substitute module('io.temporal:temporal-spring-boot-autoconfigure') using project(':temporal-spring-boot-autoconfigure')
22-
substitute module('io.temporal:temporal-spring-boot-starter') using project(':temporal-spring-boot-starter')
23-
substitute module('io.temporal:temporal-testing') using project(':temporal-testing')
24-
substitute module('io.temporal:temporal-opentracing') using project(':temporal-opentracing')
25-
}
26-
}
27-
}

0 commit comments

Comments
 (0)