Skip to content

Commit

Permalink
Added support for Spring Boot 3.0. (#30)
Browse files Browse the repository at this point in the history
* Added support for Spring Boot 3.0.
  • Loading branch information
onukristo authored May 10, 2023
1 parent 4973021 commit 60214d9
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 24 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
max-parallel: 100
matrix:
spring_boot_version:
- 2.7.8
- 3.0.6
- 2.7.11
- 2.6.14
- 2.5.14
env:
SPRING_BOOT_VERSION: ${{ matrix.spring_boot_version }}
services:
Expand All @@ -34,10 +34,14 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: "8.0"
gradle-home-cache-cleanup: true
# Comment out when you are upgrading gradle in a branch and doing tons of commits you would need to test.
# cache-read-only: false
Expand Down Expand Up @@ -110,7 +114,6 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: "8.0"
gradle-home-cache-cleanup: true
# Comment out when you are upgrading gradle in a branch and doing tons of commits you would need to test.
# cache-read-only: false
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.10.0] - 2023-05-09

### Added

* Support for Spring Boot 3.0.

### Removed

* Support for Spring Boot 2.5.

## [2.9.0] - 2023-05-03

### Added
Expand Down
26 changes: 20 additions & 6 deletions build.common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,24 @@ configurations {
}

dependencies {
local platform(libraries.springBootDependencies + '!!')
local libraries.lombok
local libraries.spotbugsAnnotations
local platform(libraries.springBootDependencies)

compileOnly libraries.lombok
annotationProcessor libraries.lombok
testCompileOnly libraries.lombok
testAnnotationProcessor libraries.lombok

compileOnly libraries.spotbugsAnnotations
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
if (springBootVersion.startsWith("3.")) {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
} else {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
withSourcesJar()
withJavadocJar()
}
Expand All @@ -78,7 +88,11 @@ compileJava {
options.forkOptions.jvmArgs << '-Xmx256m'

javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(11)
if (springBootVersion.startsWith("3.")) {
languageVersion = JavaLanguageVersion.of(17)
} else {
languageVersion = JavaLanguageVersion.of(11)
}
}
}

Expand Down
16 changes: 8 additions & 8 deletions build.libraries.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ ext {
libraries = [
// explicit versions
guava : "com.google.guava:guava:31.1-jre",
jsqlParser : "com.github.jsqlparser:jsqlparser:4.5",
jsqlParser : "com.github.jsqlparser:jsqlparser:4.6",
spotbugsAnnotations : "com.github.spotbugs:spotbugs-annotations:${spotbugs.toolVersion.get()}",
springBootDependencies : "org.springframework.boot:spring-boot-dependencies:${springBootVersion}",
testContainersMariaDb : "org.testcontainers:mariadb:1.17.6",
twBaseUtils : "com.transferwise.common:tw-base-utils:1.9.0",
twContext : "com.transferwise.common:tw-context:0.11.1",
twContextStarter : "com.transferwise.common:tw-context-starter:0.11.1",
twGracefulShutdown : 'com.transferwise.common:tw-graceful-shutdown:2.8.0',
twGracefulShutdownInterfaces : 'com.transferwise.common:tw-graceful-shutdown-interfaces:2.8.0',
twSpyqlCore : "com.transferwise.common:tw-spyql-core:1.5.0",
twSpyqlStarter : "com.transferwise.common:tw-spyql-starter:1.5.0",
twBaseUtils : "com.transferwise.common:tw-base-utils:1.10.1",
twContext : "com.transferwise.common:tw-context:0.12.0",
twContextStarter : "com.transferwise.common:tw-context-starter:0.12.0",
twGracefulShutdown : 'com.transferwise.common:tw-graceful-shutdown:2.11.0',
twGracefulShutdownInterfaces : 'com.transferwise.common:tw-graceful-shutdown-interfaces:2.11.0',
twSpyqlCore : "com.transferwise.common:tw-spyql-core:1.6.0",
twSpyqlStarter : "com.transferwise.common:tw-spyql-starter:1.6.0",

// versions managed by spring-boot-dependencies platform
caffeine : "com.github.ben-manes.caffeine:caffeine",
Expand Down
5 changes: 5 additions & 0 deletions build.publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ publishing {
developerConnection = projectScmConnection
url = projectScmUrl
}
withXml {
if (!asNode().dependencyManagement.isEmpty()) {
throw new IllegalStateException("There should not be any `dependencyManagement` block in POM.")
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2.9.0
version=2.10.0
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down
2 changes: 1 addition & 1 deletion tw-entrypoints-starter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {
testImplementation libraries.twGracefulShutdownInterfaces

testRuntimeOnly libraries.flywayCore
if (springBootVersion.startsWith("2.7")) {
if (springBootVersion.startsWith("2.7") || springBootVersion.startsWith("3.")) {
testRuntimeOnly libraries.flywayMysql
}
testRuntimeOnly libraries.mariadbJavaClient
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.transferwise.common.entrypoints.EntryPointsAutoConfiguration
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void initialize(ConfigurableApplicationContext applicationContext) {
}

private MariaDBContainer<? extends MariaDBContainer> startMariaDbTestContainer() {
MariaDBContainer<? extends MariaDBContainer> mySqlContainer = new MariaDBContainer<>()
MariaDBContainer<? extends MariaDBContainer> mySqlContainer = new MariaDBContainer<>("mariadb:10.6")
.withDatabaseName("mydb")
.withPassword("q1w2e3r4");

Expand Down

0 comments on commit 60214d9

Please sign in to comment.