Skip to content

Commit abb899e

Browse files
committed
TS-0 Ensure dependency alignment of jackson, jetty and jersey via platform
1 parent 4e8f208 commit abb899e

4 files changed

Lines changed: 84 additions & 85 deletions

File tree

agent/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ val jacocoVersion = libs.versions.jacoco.get()
2525
val outputVersion = "$appVersion-jacoco-$jacocoVersion"
2626

2727
dependencies {
28+
implementation(platform(libs.jetty.bom))
2829
implementation(libs.jetty.server)
2930
implementation(libs.jetty.servlet)
3031

32+
implementation(platform(libs.jersey.bom))
3133
implementation(libs.jersey.server)
3234
implementation(libs.jersey.containerServletCore)
3335
implementation(libs.jersey.containerJettyHttp)
Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
22

33
plugins {
4-
java
4+
java
55
}
66

77
group = "com.teamscale"
88

99
java {
10-
toolchain {
11-
languageVersion.set(JavaLanguageVersion.of(21))
12-
}
10+
toolchain {
11+
languageVersion.set(JavaLanguageVersion.of(21))
12+
}
1313
}
1414

1515
tasks.compileJava {
16-
options.release = 8
17-
options.compilerArgs.add("-Xlint:-options")
16+
options.release = 8
17+
options.compilerArgs.add("-Xlint:-options")
1818
}
1919

2020
tasks.compileTestJava {
21-
options.release = 21
21+
options.release = 21
2222
}
2323

2424
tasks.test {
25-
useJUnitPlatform {
26-
excludeEngines("teamscale-test-impacted")
27-
}
28-
testLogging.exceptionFormat = TestExceptionFormat.FULL
25+
useJUnitPlatform {
26+
excludeEngines("teamscale-test-impacted")
27+
}
28+
testLogging.exceptionFormat = TestExceptionFormat.FULL
2929
}
3030

3131
// Workaround until https://github.com/gradle/gradle/issues/15383 is fixed
@@ -34,16 +34,17 @@ val libs = catalogs.named("libs")
3434
fun lib(alias: String) = libs.findLibrary(alias).get()
3535

3636
dependencies {
37-
testImplementation(platform(lib("junit-bom")))
38-
testImplementation(lib("junit-jupiter"))
39-
testImplementation(lib("assertj"))
40-
testImplementation(lib("mockito-core"))
41-
testImplementation(lib("mockito-junit"))
37+
implementation(platform(lib("jackson-bom")))
38+
testImplementation(platform(lib("junit-bom")))
39+
testImplementation(lib("junit-jupiter"))
40+
testImplementation(lib("assertj"))
41+
testImplementation(lib("mockito-core"))
42+
testImplementation(lib("mockito-junit"))
4243
testImplementation(lib("mockito-kotlin"))
4344

44-
testRuntimeOnly(lib("junit-platform-launcher"))
45+
testRuntimeOnly(lib("junit-platform-launcher"))
4546

46-
constraints {
47-
implementation("org.apache.commons:commons-compress:1.27.1")
48-
}
47+
constraints {
48+
implementation("org.apache.commons:commons-compress:1.27.1")
49+
}
4950
}

gradle/libs.versions.toml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
[versions]
2-
jetty = "9.4.57.v20241219"
3-
jersey = "2.46"
4-
jackson = "2.19.0"
52
# When upgrading JaCoCo to a newer version, make sure to
63
# check the comment in the OpenAnalyzer.java, JaCoCoPreMain.java and CachingInstructionsBuilder.java
74
# and update the internal_xxxxxx hash included in the imports in LenientCoverageTransformer.java and JaCoCoPreMain.java.
@@ -16,20 +13,19 @@ picocli = "4.7.7"
1613
maven = "3.9.9"
1714

1815
[libraries]
19-
jetty-server = { module = "org.eclipse.jetty:jetty-server", version.ref = "jetty" }
20-
jetty-servlet = { module = "org.eclipse.jetty:jetty-servlet", version.ref = "jetty" }
21-
22-
jersey-server = { module = "org.glassfish.jersey.core:jersey-server", version.ref = "jersey" }
23-
jersey-containerJettyHttp = { module = "org.glassfish.jersey.containers:jersey-container-jetty-http", version.ref = "jersey" }
24-
jersey-containerServletCore = { module = "org.glassfish.jersey.containers:jersey-container-servlet-core", version.ref = "jersey" }
25-
jersey-mediaJsonJackson = { module = "org.glassfish.jersey.media:jersey-media-json-jackson", version.ref = "jersey" }
26-
jersey-hk2 = { module = "org.glassfish.jersey.inject:jersey-hk2", version.ref = "jersey" }
27-
28-
jackson-bom = { module = "com.fasterxml.jackson:jackson-bom", version.ref = "jackson" }
29-
jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" }
30-
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
31-
jackson-jakarta-xmlbindAnnotations = { module = "com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations", version.ref = "jackson" }
32-
jackson-jakarta-rsJsonProvider = { module = "com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-json-provider", version.ref = "jackson" }
16+
jetty-bom = { module = "org.eclipse.jetty:jetty-bom", version = "9.4.57.v20241219" }
17+
jetty-server = { module = "org.eclipse.jetty:jetty-server" }
18+
jetty-servlet = { module = "org.eclipse.jetty:jetty-servlet" }
19+
20+
jersey-bom = { module = "org.glassfish.jersey:jersey-bom", version = "2.46" }
21+
jersey-server = { module = "org.glassfish.jersey.core:jersey-server" }
22+
jersey-containerJettyHttp = { module = "org.glassfish.jersey.containers:jersey-container-jetty-http" }
23+
jersey-containerServletCore = { module = "org.glassfish.jersey.containers:jersey-container-servlet-core" }
24+
jersey-mediaJsonJackson = { module = "org.glassfish.jersey.media:jersey-media-json-jackson" }
25+
jersey-hk2 = { module = "org.glassfish.jersey.inject:jersey-hk2" }
26+
27+
jackson-bom = { module = "com.fasterxml.jackson:jackson-bom", version = "2.19.0" }
28+
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind" }
3329

3430
jakarta-activation-api = { module = "jakarta.activation:jakarta.activation-api", version = "1.2.2" }
3531

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
11
plugins {
2-
`java-gradle-plugin`
3-
`kotlin-dsl`
4-
com.teamscale.`java-convention`
5-
com.teamscale.coverage
6-
com.teamscale.publish
7-
alias(libs.plugins.pluginPublish)
2+
`java-gradle-plugin`
3+
`kotlin-dsl`
4+
com.teamscale.`java-convention`
5+
com.teamscale.coverage
6+
com.teamscale.publish
7+
alias(libs.plugins.pluginPublish)
88
}
99

1010
java {
11-
toolchain {
12-
languageVersion.set(JavaLanguageVersion.of(11))
13-
}
11+
toolchain {
12+
languageVersion.set(JavaLanguageVersion.of(11))
13+
}
1414
}
1515

1616
tasks.withType<JavaCompile> {
17-
options.release = 11
17+
options.release = 11
1818
}
1919

2020
publishAs {
21-
readableName.set("Teamscale Gradle Plugin")
22-
description.set("A Gradle plugin that supports collecting Testwise Coverage and uploading reports to Teamscale.")
21+
readableName.set("Teamscale Gradle Plugin")
22+
description.set("A Gradle plugin that supports collecting Testwise Coverage and uploading reports to Teamscale.")
2323
}
2424

2525
gradlePlugin {
26-
website.set("https://www.teamscale.com/")
27-
vcsUrl.set("https://github.com/cqse/teamscale-jacoco-agent")
28-
plugins {
29-
create("teamscalePlugin") {
30-
id = "com.teamscale"
31-
displayName = "Teamscale Gradle plugin"
32-
implementationClass = "com.teamscale.TeamscalePlugin"
33-
description = "Supports collecting Testwise Coverage and uploading reports to Teamscale."
34-
tags.set(listOf("teamscale", "coverage", "tga", "test", "gap", "junit", "upload"))
35-
}
36-
create("teamscaleAggregationPlugin") {
37-
id = "com.teamscale.aggregation"
38-
displayName = "Teamscale Gradle aggregation plugin"
39-
implementationClass = "com.teamscale.aggregation.TeamscaleAggregationPlugin"
40-
description = "Supports aggregating test execution and coverage data."
41-
tags.set(listOf("teamscale", "coverage", "tga", "test", "gap", "junit", "aggregation"))
42-
}
43-
}
26+
website.set("https://www.teamscale.com/")
27+
vcsUrl.set("https://github.com/cqse/teamscale-jacoco-agent")
28+
plugins {
29+
create("teamscalePlugin") {
30+
id = "com.teamscale"
31+
displayName = "Teamscale Gradle plugin"
32+
implementationClass = "com.teamscale.TeamscalePlugin"
33+
description = "Supports collecting Testwise Coverage and uploading reports to Teamscale."
34+
tags.set(listOf("teamscale", "coverage", "tga", "test", "gap", "junit", "upload"))
35+
}
36+
create("teamscaleAggregationPlugin") {
37+
id = "com.teamscale.aggregation"
38+
displayName = "Teamscale Gradle aggregation plugin"
39+
implementationClass = "com.teamscale.aggregation.TeamscaleAggregationPlugin"
40+
description = "Supports aggregating test execution and coverage data."
41+
tags.set(listOf("teamscale", "coverage", "tga", "test", "gap", "junit", "aggregation"))
42+
}
43+
}
4444
}
4545

4646
dependencies {
47-
implementation(project(":teamscale-client"))
48-
implementation(project(":report-generator"))
49-
implementation(gradleApi())
50-
implementation(libs.jgit)
51-
implementation(libs.jackson.databind)
52-
testImplementation(libs.okio)
53-
testImplementation(project(":common-system-test"))
47+
implementation(project(":teamscale-client"))
48+
implementation(project(":report-generator"))
49+
implementation(gradleApi())
50+
implementation(libs.jgit)
51+
implementation(libs.jackson.databind)
52+
testImplementation(libs.okio)
53+
testImplementation(project(":common-system-test"))
5454
}
5555

5656
tasks.processResources {
57-
inputs.property("version", version)
58-
filesMatching("**/plugin.properties") {
59-
filter {
60-
it.replace("%PLUGIN_VERSION_TOKEN_REPLACED_DURING_BUILD%", version.toString())
61-
}
62-
}
57+
inputs.property("version", version)
58+
filesMatching("**/plugin.properties") {
59+
filter {
60+
it.replace("%PLUGIN_VERSION_TOKEN_REPLACED_DURING_BUILD%", version.toString())
61+
}
62+
}
6363
}
6464

6565
tasks.test {
66-
dependsOn(":agent:publishToMavenLocal")
67-
dependsOn(":impacted-test-engine:publishToMavenLocal")
68-
dependsOn(":teamscale-client:publishToMavenLocal")
69-
dependsOn(":tia-client:publishToMavenLocal")
70-
dependsOn(":report-generator:publishToMavenLocal")
66+
dependsOn(":agent:publishToMavenLocal")
67+
dependsOn(":impacted-test-engine:publishToMavenLocal")
68+
dependsOn(":teamscale-client:publishToMavenLocal")
69+
dependsOn(":tia-client:publishToMavenLocal")
70+
dependsOn(":report-generator:publishToMavenLocal")
7171
}

0 commit comments

Comments
 (0)