Skip to content

Commit 3f691c9

Browse files
authored
migrate to libs.versions.toml file (#359)
1 parent c16c698 commit 3f691c9

5 files changed

Lines changed: 113 additions & 51 deletions

File tree

build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
plugins {
22
id("pmd")
3-
id("com.diffplug.spotless") version "8.3.0"
4-
id("com.github.ben-manes.versions") version "0.53.0"
5-
id("com.vanniktech.maven.publish") version "0.36.0" apply false
6-
kotlin("jvm") version "2.3.10" apply false
3+
alias(libs.plugins.spotless)
4+
alias(libs.plugins.versions)
5+
alias(libs.plugins.maven.publish) apply false
6+
alias(libs.plugins.kotlin.jvm) apply false
77
}
88

99
fun runCommand(vararg args: String): String {

gradle/libs.versions.toml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[versions]
2+
aspectj = "1.9.22.1"
3+
assertj = "3.27.3"
4+
cron-utils = "9.2.1"
5+
hikaricp = "7.0.2"
6+
jackson = "2.21.2"
7+
java-websocket = "1.6.0"
8+
jspecify = "1.0.0"
9+
junit = "6.0.3"
10+
junit-pioneer = "2.3.0"
11+
kotlin = "2.3.10"
12+
logback = "1.5.32"
13+
maven-artifact = "3.9.13"
14+
maven-publish = "0.36.0"
15+
mockito = "5.23.0"
16+
picocli = "4.7.7"
17+
postgresql = "42.7.10"
18+
rest-assured = "6.0.0"
19+
shadow = "9.4.1"
20+
slf4j = "2.0.17"
21+
spotless = "8.4.0"
22+
spring-boot = "3.4.4"
23+
spring-framework = "6.2.5"
24+
system-stubs = "2.1.8"
25+
testcontainers = "2.0.4"
26+
versions = "0.53.0"
27+
28+
[libraries]
29+
aspectjweaver = { module = "org.aspectj:aspectjweaver", version.ref = "aspectj" }
30+
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj" }
31+
cron-utils = { module = "com.cronutils:cron-utils", version.ref = "cron-utils" }
32+
hikaricp = { module = "com.zaxxer:HikariCP", version.ref = "hikaricp" }
33+
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
34+
jackson-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "jackson" }
35+
java-websocket = { module = "org.java-websocket:Java-WebSocket", version.ref = "java-websocket" }
36+
jspecify = { module = "org.jspecify:jspecify", version.ref = "jspecify" }
37+
junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" }
38+
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter" }
39+
junit-pioneer = { module = "org.junit-pioneer:junit-pioneer", version.ref = "junit-pioneer" }
40+
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" }
41+
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
42+
maven-artifact = { module = "org.apache.maven:maven-artifact", version.ref = "maven-artifact" }
43+
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" }
44+
picocli = { module = "info.picocli:picocli", version.ref = "picocli" }
45+
postgresql = { module = "org.postgresql:postgresql", version.ref = "postgresql" }
46+
rest-assured = { module = "io.rest-assured:rest-assured", version.ref = "rest-assured" }
47+
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
48+
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" }
49+
spring-aop = { module = "org.springframework:spring-aop", version.ref = "spring-framework" }
50+
spring-boot-autoconfigure = { module = "org.springframework.boot:spring-boot-autoconfigure", version.ref = "spring-boot" }
51+
spring-boot-configuration-processor = { module = "org.springframework.boot:spring-boot-configuration-processor", version.ref = "spring-boot" }
52+
spring-boot-test = { module = "org.springframework.boot:spring-boot-test", version.ref = "spring-boot" }
53+
system-stubs-jupiter = { module = "uk.org.webcompere:system-stubs-jupiter", version.ref = "system-stubs" }
54+
testcontainers-postgresql = { module = "org.testcontainers:testcontainers-postgresql", version.ref = "testcontainers" }
55+
56+
[bundles]
57+
jackson = ["jackson-databind", "jackson-jsr310"]
58+
59+
[plugins]
60+
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
61+
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }
62+
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
63+
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
64+
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }

transact-cli/build.gradle.kts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
plugins {
22
application
3-
id("com.gradleup.shadow") version "9.3.2"
3+
alias(libs.plugins.shadow)
44
}
55

66
application { mainClass.set("dev.dbos.transact.cli.Main") }
77

88
dependencies {
99
implementation(project(":transact"))
10-
implementation("com.fasterxml.jackson.core:jackson-databind:2.21.1")
11-
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.1")
12-
implementation("info.picocli:picocli:4.7.7")
13-
runtimeOnly("org.slf4j:slf4j-simple:2.0.17")
10+
implementation(libs.bundles.jackson)
11+
implementation(libs.picocli)
12+
runtimeOnly(libs.slf4j.simple)
1413

15-
testImplementation(platform("org.junit:junit-bom:6.0.3"))
16-
testImplementation("org.junit.jupiter:junit-jupiter")
17-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
18-
testImplementation("org.testcontainers:testcontainers-postgresql:2.0.3")
14+
testImplementation(platform(libs.junit.bom))
15+
testImplementation(libs.junit.jupiter)
16+
testRuntimeOnly(libs.junit.platform.launcher)
17+
testImplementation(libs.testcontainers.postgresql)
1918
}
2019

2120
tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {

transact-spring-boot-starter/build.gradle.kts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import com.vanniktech.maven.publish.DeploymentValidation
22

33
plugins {
44
id("java-library")
5-
id("com.vanniktech.maven.publish")
5+
alias(libs.plugins.maven.publish)
66
}
77

88
tasks.withType<JavaCompile> {
@@ -23,22 +23,22 @@ tasks.named("build") { dependsOn("javadoc") }
2323

2424
dependencies {
2525
api(project(":transact"))
26-
compileOnly("org.springframework.boot:spring-boot-autoconfigure:3.4.4")
27-
compileOnly("org.springframework:spring-aop:6.2.5")
28-
compileOnly("org.aspectj:aspectjweaver:1.9.22.1")
29-
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor:3.4.4")
26+
compileOnly(libs.spring.boot.autoconfigure)
27+
compileOnly(libs.spring.aop)
28+
compileOnly(libs.aspectjweaver)
29+
annotationProcessor(libs.spring.boot.configuration.processor)
3030

31-
testImplementation(platform("org.junit:junit-bom:6.0.3"))
32-
testImplementation("org.junit.jupiter:junit-jupiter")
33-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
31+
testImplementation(platform(libs.junit.bom))
32+
testImplementation(libs.junit.jupiter)
33+
testRuntimeOnly(libs.junit.platform.launcher)
3434

35-
testImplementation("org.springframework.boot:spring-boot-test:3.4.4")
36-
testImplementation("org.assertj:assertj-core:3.27.3")
37-
testImplementation("org.springframework.boot:spring-boot-autoconfigure:3.4.4")
38-
testImplementation("org.springframework:spring-aop:6.2.5")
39-
testImplementation("org.aspectj:aspectjweaver:1.9.22.1")
40-
testImplementation("org.mockito:mockito-core:5.22.0")
41-
testRuntimeOnly("ch.qos.logback:logback-classic:1.5.32")
35+
testImplementation(libs.spring.boot.test)
36+
testImplementation(libs.assertj.core)
37+
testImplementation(libs.spring.boot.autoconfigure)
38+
testImplementation(libs.spring.aop)
39+
testImplementation(libs.aspectjweaver)
40+
testImplementation(libs.mockito.core)
41+
testRuntimeOnly(libs.logback.classic)
4242
}
4343

4444
val publishingToMavenCentral =

transact/build.gradle.kts

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
55
plugins {
66
id("java")
77
id("java-library")
8-
kotlin("jvm")
9-
id("com.vanniktech.maven.publish")
8+
alias(libs.plugins.kotlin.jvm)
9+
alias(libs.plugins.maven.publish)
1010
}
1111

1212
tasks.withType<JavaCompile> {
@@ -26,27 +26,26 @@ tasks.withType<Javadoc> {
2626
tasks.named("build") { dependsOn("javadoc") }
2727

2828
dependencies {
29-
api("org.slf4j:slf4j-api:2.0.17") // logging api
30-
api("org.jspecify:jspecify:1.0.0")
31-
32-
implementation("org.postgresql:postgresql:42.7.10")
33-
implementation("com.zaxxer:HikariCP:7.0.2") // Connection pool
34-
implementation("com.fasterxml.jackson.core:jackson-databind:2.21.1") // json
35-
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.1")
36-
implementation("com.cronutils:cron-utils:9.2.1") // cron for scheduled wf
37-
38-
testImplementation(platform("org.junit:junit-bom:6.0.3"))
39-
testImplementation("org.junit.jupiter:junit-jupiter")
40-
testImplementation("org.junit-pioneer:junit-pioneer:2.3.0")
41-
testImplementation("uk.org.webcompere:system-stubs-jupiter:2.1.8")
42-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
43-
44-
testImplementation("org.java-websocket:Java-WebSocket:1.6.0")
45-
testImplementation("ch.qos.logback:logback-classic:1.5.32")
46-
testImplementation("org.mockito:mockito-core:5.22.0")
47-
testImplementation("io.rest-assured:rest-assured:6.0.0")
48-
testImplementation("org.apache.maven:maven-artifact:3.9.13")
49-
testImplementation("org.testcontainers:testcontainers-postgresql:2.0.3")
29+
api(libs.slf4j.api)
30+
api(libs.jspecify)
31+
32+
implementation(libs.postgresql)
33+
implementation(libs.hikaricp)
34+
implementation(libs.bundles.jackson)
35+
implementation(libs.cron.utils)
36+
37+
testImplementation(platform(libs.junit.bom))
38+
testImplementation(libs.junit.jupiter)
39+
testImplementation(libs.junit.pioneer)
40+
testImplementation(libs.system.stubs.jupiter)
41+
testRuntimeOnly(libs.junit.platform.launcher)
42+
43+
testImplementation(libs.java.websocket)
44+
testImplementation(libs.logback.classic)
45+
testImplementation(libs.mockito.core)
46+
testImplementation(libs.rest.assured)
47+
testImplementation(libs.maven.artifact)
48+
testImplementation(libs.testcontainers.postgresql)
5049
}
5150

5251
val projectVersion = project.version.toString()

0 commit comments

Comments
 (0)