Skip to content

Commit 41dcca0

Browse files
authored
Fix Gradle warning
> The automatic loading of test framework implementation dependencies > has been deprecated. This is scheduled to be removed in Gradle 9.0. > Declare the desired test framework directly on the test suite or > explicitly declare the test framework implementation dependencies on > the test's runtime classpath. > Consult the upgrading guide for further information: > https://docs.gradle.org/8.10.1/userguide/upgrading_version_8.html According to which > If using JUnit 5, an explicit `runtimeOnly` dependency on > `junit-platform-launcher` is required in addition to the existing > `implementation` dependency on the test engine.
1 parent cc6b52b commit 41dcca0

File tree

12 files changed

+22
-30
lines changed

12 files changed

+22
-30
lines changed

its/plugin/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
dependencies {
22
testImplementation(testLibs.sonarlint.core)
33
testImplementation(testLibs.sonar.orchestrator.junit5)
4-
testImplementation(testLibs.junit.engine)
4+
testImplementation(testLibs.junit.jupiter)
5+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
56
testImplementation(testLibs.assertj.core)
67
testImplementation(testLibs.sonar.ws)
78
testImplementation(libs.sonar.analyzer.commons)

its/ruling/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ plugins {
66
dependencies {
77
testImplementation(testLibs.sonar.orchestrator.junit5)
88
testImplementation(testLibs.assertj.core)
9-
testImplementation(testLibs.junit.engine)
9+
testImplementation(testLibs.junit.jupiter)
10+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
1011
testImplementation(libs.sonar.analyzer.commons)
1112
}
1213

settings.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ dependencyResolutionManagement {
8080
val sonarqube = version("sonarqube", "10.0.0.68432")
8181

8282
library("assertj-core", "org.assertj", "assertj-core").versionRef(assertj)
83-
library("junit-api", "org.junit.jupiter", "junit-jupiter-api").versionRef(junit)
84-
library("junit-engine", "org.junit.jupiter", "junit-jupiter-engine").versionRef(junit)
85-
library("junit-params", "org.junit.jupiter", "junit-jupiter-params").versionRef(junit)
83+
library("junit-jupiter", "org.junit.jupiter", "junit-jupiter").versionRef(junit)
8684
library("mockito-core", "org.mockito", "mockito-core").versionRef(mockito)
8785
library("mockk", "io.mockk", "mockk").versionRef(mockk)
8886
library("sonar-analyzer-test-commons", "org.sonarsource.analyzer-commons", "sonar-analyzer-test-commons")

sonar-kotlin-api/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ dependencies {
1414
implementation(libs.gson)
1515
implementation(libs.sonar.analyzer.commons.recognizers)
1616

17-
testRuntimeOnly(testLibs.junit.engine)
17+
testImplementation(testLibs.junit.jupiter)
18+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
1819
testImplementation(libs.slf4j.api)
19-
testImplementation(testLibs.junit.api)
20-
testImplementation(testLibs.junit.params)
2120
testImplementation(testLibs.assertj.core)
2221
testImplementation(testLibs.mockito.core)
2322
testImplementation(testLibs.mockk)

sonar-kotlin-checks/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ dependencies {
1515

1616
implementation(project(":sonar-kotlin-api"))
1717

18-
testRuntimeOnly(testLibs.junit.engine)
19-
testImplementation(testLibs.junit.api)
20-
testImplementation(testLibs.junit.params)
18+
testImplementation(testLibs.junit.jupiter)
19+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
2120
testImplementation(testLibs.assertj.core)
2221
testImplementation(testLibs.mockito.core)
2322
testImplementation(testLibs.mockk)

sonar-kotlin-external-linters/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ dependencies {
1616

1717
implementation(project(":sonar-kotlin-api"))
1818

19-
testRuntimeOnly(testLibs.junit.engine)
19+
testImplementation(testLibs.junit.jupiter)
20+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
2021
testImplementation(libs.slf4j.api)
21-
testImplementation(testLibs.junit.api)
22-
testImplementation(testLibs.junit.params)
2322
testImplementation(testLibs.assertj.core)
2423
testImplementation(testLibs.mockito.core)
2524
testImplementation(testLibs.mockk)

sonar-kotlin-gradle/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ dependencies {
2121
implementation(project(":sonar-kotlin-api"))
2222
implementation(project(":sonar-kotlin-surefire"))
2323

24-
testRuntimeOnly(testLibs.junit.engine)
24+
testImplementation(testLibs.junit.jupiter)
25+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
2526
testImplementation(libs.slf4j.api)
26-
testImplementation(testLibs.junit.api)
27-
testImplementation(testLibs.junit.params)
2827
testImplementation(testLibs.assertj.core)
2928
testImplementation(testLibs.mockito.core)
3029
testImplementation(testLibs.mockk)

sonar-kotlin-metrics/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ dependencies {
2020
implementation(project(":sonar-kotlin-api"))
2121
implementation(project(":sonar-kotlin-checks"))
2222

23-
testRuntimeOnly(testLibs.junit.engine)
24-
testImplementation(testLibs.junit.api)
25-
testImplementation(testLibs.junit.params)
23+
testImplementation(testLibs.junit.jupiter)
24+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
2625
testImplementation(testLibs.assertj.core)
2726
testImplementation(testLibs.mockito.core)
2827
testImplementation(testLibs.mockk)

sonar-kotlin-plugin/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ dependencies {
3131
implementation(project(":sonar-kotlin-surefire"))
3232
implementation(project(":sonar-kotlin-checks"))
3333

34-
testRuntimeOnly(testLibs.junit.engine)
34+
testImplementation(testLibs.junit.jupiter)
35+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
3536
testImplementation(libs.slf4j.api)
36-
testImplementation(testLibs.junit.api)
37-
testImplementation(testLibs.junit.params)
3837
testImplementation(testLibs.assertj.core)
3938
testImplementation(testLibs.mockito.core)
4039
testImplementation(testLibs.mockk)

sonar-kotlin-surefire/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ dependencies {
1313
implementation(libs.gson)
1414
implementation(libs.sonar.analyzer.commons.recognizers)
1515

16-
testRuntimeOnly(testLibs.junit.engine)
16+
testImplementation(testLibs.junit.jupiter)
17+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
1718
testImplementation(libs.slf4j.api)
18-
testImplementation(testLibs.junit.api)
19-
testImplementation(testLibs.junit.params)
2019
testImplementation(testLibs.assertj.core)
2120
testImplementation(testLibs.mockito.core)
2221
testImplementation(testLibs.mockk)

0 commit comments

Comments
 (0)