Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDIT-2488 Upgrade to Spring Boot 3.4.2 #350

Merged
merged 7 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "2.0.21"
kotlin("jvm") version "2.1.0"
id("com.gradle.plugin-publish") version "1.3.0"
id("java-gradle-plugin")
id("maven-publish")
id("com.github.ben-manes.versions") version "0.51.0"
id("com.github.ben-manes.versions") version "0.52.0"
id("se.patrikerdes.use-latest-versions") version "0.2.18"
// This is not using the latest version due to https://github.com/jeremylong/DependencyCheck?tab=readme-ov-file#the-nvd-api-key-ci-and-rate-limiting
id("org.owasp.dependencycheck") version "8.4.3"
id("com.adarshr.test-logger") version "4.0.0"
id("org.jlleitschuh.gradle.ktlint") version "12.1.2"
Expand All @@ -30,7 +31,7 @@ fun isNonStable(version: String): Boolean {
}

group = "uk.gov.justice.hmpps.gradle"
version = "6.1.2"
version = "7.0.0-beta"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is a breaking change I've decided to go for a beta version. I'm not sure this is totally necessary but the breaking change made me twitchy,.


gradlePlugin {
website.set("https://github.com/ministryofjustice/dps-gradle-spring-boot")
Expand All @@ -50,20 +51,20 @@ gradlePlugin {
dependencies {
implementation(kotlin("reflect"))

implementation("org.springframework.boot:spring-boot-gradle-plugin:3.4.1")
implementation("org.springframework.boot:spring-boot-gradle-plugin:3.4.2")
implementation(kotlin("gradle-plugin"))
implementation("io.spring.dependency-management:io.spring.dependency-management.gradle.plugin:1.1.7")
implementation("org.owasp:dependency-check-core:8.4.3")
implementation("org.owasp:dependency-check-gradle:8.4.3")
implementation("com.github.ben-manes:gradle-versions-plugin:0.51.0")
implementation("com.github.ben-manes:gradle-versions-plugin:0.52.0")
implementation("com.gorylenko.gradle-git-properties:com.gorylenko.gradle-git-properties.gradle.plugin:2.4.2")
implementation("com.adarshr.test-logger:com.adarshr.test-logger.gradle.plugin:4.0.0")
implementation("se.patrikerdes.use-latest-versions:se.patrikerdes.use-latest-versions.gradle.plugin:0.2.18")
implementation("org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin:12.1.2")

testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
testImplementation("org.mockito:mockito-junit-jupiter:5.14.2")
testImplementation("org.assertj:assertj-core:3.27.0")
testImplementation("org.mockito:mockito-junit-jupiter:5.15.2")
testImplementation("org.assertj:assertj-core:3.27.3")
testImplementation("net.javacrumbs.json-unit:json-unit-assertj:4.1.0")
testImplementation("com.google.code.gson:gson:2.11.0")
testImplementation("org.eclipse.jgit:org.eclipse.jgit:7.1.0.202411261347-r")
Expand Down
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.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
30 changes: 30 additions & 0 deletions release-notes/7.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 7.0.0

## Breaking changes

### ktlint

This upgrade to Kotlin 2.1.0 breaks the ktlint Spring Boot Plugin as detailed in this issue: https://github.com/JLLeitschuh/ktlint-gradle/issues/809

To fix this we've upgraded the version of ktlint to the latest version. Unfortunately this causes `ktlintCheck` formatting issues on most projects.

Action required: run command `./gradlew ktlintFormat`

## Version upgrades

Gradle [8.11.1 -> 8.12]]

### Plugins
- Kotlin jvm [2.0.21 -> 2.1.0]
- com.github.ben-manes.versions [0.51.0 -> 0.52.0]

### Dependencies applied by plugins
- ktlint [1.0.1 -> 1.5.0]]

### Dependencies
- org.springframework.boot:spring-boot-gradle-plugin [3.4.1 -> 3.4.2]
- com.github.ben-manes:gradle-versions-plugin [0.51.0 -> 0.52.0]

### Test Dependencies
- org.mockito:mockito-junit-jupiter [5.14.2 -> 5.15.2]
- org.assertj:assertj-core [3.27.0 -> 3.27.3]
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import org.gradle.api.tasks.Copy
import uk.gov.justice.digital.hmpps.gradle.ConfigManager

private const val APP_INSIGHTS_VERSION = "3.6.2"

// This should be kept at the same version as used by App Insights: https://github.com/microsoft/ApplicationInsights-Java/blob/3.6.2/dependencyManagement/build.gradle.kts#L14
const val OPENTELEMETRY_VERSION = "1.43.0"

class AppInsightsConfigManager(override val project: Project) : ConfigManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ package uk.gov.justice.digital.hmpps.gradle.pluginmanagers

import org.gradle.api.Project
import org.gradle.api.Task
import org.jlleitschuh.gradle.ktlint.KtlintExtension
import org.jlleitschuh.gradle.ktlint.KtlintPlugin
import uk.gov.justice.digital.hmpps.gradle.PluginManager

// TODO The ktlint version applied by the ktlint plugin needs pinning to 1.5.0 to workaround this issue: https://github.com/JLLeitschuh/ktlint-gradle/issues/809
// TODO Once the issue is solved we should stop pinning the version and take the default version provided by the ktlint plugin
private const val KTLINT_VERSION = "1.5.0"

class KtlintPluginManager(override val project: Project) : PluginManager {

override val pluginProject = KtlintPlugin::class.java
Expand All @@ -14,6 +19,8 @@ class KtlintPluginManager(override val project: Project) : PluginManager {
it.dependsOn("${getProjectPrefix(it)}:ktlintCheck")
}

(project.extensions.getByName("ktlint") as KtlintExtension).version.set(KTLINT_VERSION)

copyResourcesFile(".editorconfig")
}

Expand Down