Skip to content

Commit

Permalink
allow support for both spring boot 2 and 3
Browse files Browse the repository at this point in the history
Signed-off-by: Tihomir Surdilovic <[email protected]>
  • Loading branch information
tsurdilo committed Dec 29, 2023
1 parent 669b7d3 commit 594f286
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ It contains two modules:
## Requirements

- Java 1.8+ for build and runtime of core samples
- Java 1.17+ for build and runtime of Spring Boot samples
- Java 1.8+ for build and runtime of SpringBoot samples when using SpringBoot 2
- Java 1.17+ for build and runtime of Spring Boot samples when using SpringBoot 3
- Local Temporal Server, easiest to get started would be using [Temporal CLI](https://github.com/temporalio/cli).
For more options see docs [here](https://docs.temporal.io/kb/all-the-ways-to-run-a-cluster).

Expand Down Expand Up @@ -133,7 +134,8 @@ See the README.md file in each main sample directory for cut/paste Gradle comman

### Running SpringBoot Samples

These samples use SpringBoot 3
These samples use SpringBoot 2 by default. To switch to using SpringBoot 3 look at the [gradle.properties](gradle.properties) file
and follow simple instructions there.

1. Start SpringBoot from main repo dir:

Expand Down
12 changes: 11 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'org.cadixdev.licenser' version '0.6.1'
id "net.ltgt.errorprone" version "3.1.0"
id 'com.diffplug.spotless' version '6.22.0' apply false
id 'org.springframework.boot' version '3.2.0'
id "org.springframework.boot" version "${springBootPluginVersion}"
}

subprojects {
Expand All @@ -15,6 +15,16 @@ subprojects {
options.compilerArgs << "-Werror"
}

java {
if(project.property("springBootPluginVersion") == "2.7.13") {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
} else {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

ext {
otelVersion = '1.30.1'
otelVersionAlpha = "${otelVersion}-alpha"
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
springBootPluginVersion=2.7.13

# use this for spring boot 3 support
#springBootPluginVersion=3.2.0
5 changes: 0 additions & 5 deletions springboot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,4 @@ bootJar {

jar {
enabled = true
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

0 comments on commit 594f286

Please sign in to comment.