Skip to content

Commit

Permalink
move more versions to catalogue
Browse files Browse the repository at this point in the history
  • Loading branch information
tillkuhn committed Jan 2, 2024
1 parent 8dad075 commit e4b9ad4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 32 deletions.
33 changes: 10 additions & 23 deletions kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
// val postgresVersion: String by System.getProperties()
dependencies {
classpath(libs.postgresql)
classpath(libs.kotlin.gradle.plugin)
Expand All @@ -10,8 +9,8 @@ buildscript {
}
// Customize Managed Version
// https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#managing-dependencies.dependency-management-plugin.customizing
// Mitigate https://jira.qos.ch/browse/LOGBACK-1591 until it's part of Spring Boot's mainline
extra.apply {
// Mitigate https://jira.qos.ch/browse/LOGBACK-1591 until it's part of Spring Boot's mainline
// with recent spring v2.6.5, logback version is already on 1.2.11 so we no longer need this
// set("logback.version", "1.2.8")
}
Expand All @@ -23,9 +22,7 @@ java.sourceCompatibility = JavaVersion.VERSION_17

plugins {
val kotlinVersion = libs.versions.kotlin.get()
// val flywayVersion: String by System.getProperties()
// val springBootVersion: String by System.getProperties()
val versionsVersion: String by System.getProperties()
// val versionsVersion: String by System.getProperties()

// https://docs.gradle.org/current/userguide/platforms.html
// Using alias we can reference the plugin id and version
Expand All @@ -36,12 +33,9 @@ plugins {
alias(libs.plugins.spring.dep.mgmt)
alias(libs.plugins.flyway.plugin)


// id("org.springframework.boot") version springBootVersion
// id("io.spring.dependency-management") version "1.1.3"
//id("org.flywaydb.flyway") version flywayVersion
// Plugin to determine which dependencies have updates, including updates for gradle itself.
id("com.github.ben-manes.versions") version versionsVersion
alias(libs.plugins.versions)

// Gradle plugin for running SonarQube analysis. https://plugins.gradle.org/plugin/org.sonarqube
id("org.sonarqube") version "4.3.1.3277" // new ones may cause issues against sonarcloud.io, so test first

Expand Down Expand Up @@ -98,25 +92,18 @@ dependencies {
testImplementation(kotlin("test-junit5"))

// Commons, HTTP Client, RSS and other Network Communication Stuff
val unirestVersion: String by System.getProperties()
val commonsLangVersion: String by System.getProperties()
val romeVersion: String by System.getProperties()
val bucket4jVersion: String by System.getProperties()
implementation("org.apache.commons:commons-lang3:$commonsLangVersion")
implementation("com.mashape.unirest:unirest-java:$unirestVersion")
implementation ("com.rometools:rome:$romeVersion")
implementation ("com.rometools:rome-modules:$romeVersion")
// https://mvnrepository.com/artifact/com.github.vladimir-bukhtoyarov/bucket4j-core
implementation ("com.github.vladimir-bukhtoyarov:bucket4j-core:$bucket4jVersion")
implementation(libs.commons.lang3)
implementation(libs.unirest)
implementation (libs.bundles.rome)
implementation(libs.bucket4j)


// Persistence (Postgres, JPA, Hibernate)
// val postgresVersion: String by System.getProperties()
// val flywayVersion: String by System.getProperties()
val hypersistenceUtilsVersion: String by System.getProperties()
// val hypersistenceUtilsVersion: String by System.getProperties()
implementation(libs.postgresql)
implementation(libs.flyway.core)
implementation(libs.flyway.postgresql)
implementation(libs.bundles.flyway)
implementation(libs.hypersistence.utils.hibernate)

// Jackson JSON Parsing Dependencies
Expand Down
12 changes: 6 additions & 6 deletions kotlin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Version Management, update library dependency versions centrally
# DEPRECATED, move to gradle/libs.versions.toml catalog which is also supported by dependabot
systemProp.archUnitVersion=0.23.1
systemProp.bucket4jVersion=7.6.0
systemProp.commonsLangVersion=3.13.0
#systemProp.bucket4jVersion=7.6.0
#systemProp.commonsLangVersion=3.13.0
#systemProp.flywayVersion=9.21.1
#systemProp.greenmailVersion=2.1.0-alpha-1 does not work (failed test)
systemProp.greenmailVersion=2.0.0-alpha-3
# also make sure the artifact aligns with the hibernate version used by spring-boot
# e.g. hypersistence-utils-hibernate-60 (3.0) vs hypersistence-utils-hibernate-62 (3.1)
systemProp.hypersistenceUtilsVersion=3.5.1
# systemProp.hypersistenceUtilsVersion=3.5.1
#systemProp.kotlinVersion=1.9.20
systemProp.mockitoInlineVersion=4.11.0
#systemProp.postgresVersion=42.6.0
systemProp.romeVersion=1.19.0
#systemProp.romeVersion=1.19.0
#systemProp.springBootVersion=3.1.3
systemProp.unirestVersion=1.4.9
systemProp.versionsVersion=0.47.0
#systemProp.unirestVersion=1.4.9
#systemProp.versionsVersion=0.47.0
#systemProp.wiremockVersion=3.0.0-beta-10

# enable to support incremental processing
Expand Down
24 changes: 21 additions & 3 deletions kotlin/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ flyway = "10.4.1"
jacoco = "0.8.11"
kotlin = "1.9.22"
postgresql = "42.7.1"
rome = "1.19.0"
wiremock = "3.0.1"

[plugins]
# We can use shorthand notation with the plugin id and version.
# plugins were added in Gradle 7.2, are used (obviouly) to define plugins.
# use like "alias(libs.plugins.spring.boot)" in build.gradle.kts plugins section
spring-boot = "org.springframework.boot:3.2.0" # 3.1.5
versions = "com.github.ben-manes.versions:0.50.0"

# We can use the longer notation option where we set
# the id and version for the plugin.
Expand All @@ -43,20 +45,36 @@ flyway-plugin = { id = "org.flywaydb.flyway", version.ref = "flyway" }
# Define the libraries that will be later accessed in our Gradle files.
# use like "implementation(libs.flyway.core)" in build.gradle.kts dependencies section
# replace hyphens in name with dots: flyway-core -> flyway.core

bucket4j = { module = "com.github.vladimir-bukhtoyarov:bucket4j-core", version = "7.6.0" }
commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.14.0" }

# flyway libs, combined into a bundle in the "bundles" section
flyway-core = { module = "org.flywaydb:flyway-core", version.ref = "flyway" }
# since v10 we need vendor specific module, see https://github.com/flyway/flyway/issues/3780
flyway-postgresql = { module = "org.flywaydb:flyway-database-postgresql", version.ref = "flyway" }

postgresql = { module = "org.postgresql:postgresql", version.ref = "postgresql" }
# make sure to align module AND version with the hibernate version used by Spring Boot (Releases Notes)
# Example: Spring Boot 3.2 uses Hibernate 6.3, so the module is hypersistence-utils-hibernate-63
hypersistence-utils-hibernate = { module = "io.hypersistence:hypersistence-utils-hibernate-63", version="3.7.0"}
hypersistence-utils-hibernate = { module = "io.hypersistence:hypersistence-utils-hibernate-63", version = "3.7.0" }

rome-core = { module = "com.rometools:rome", version.ref = "rome" }
rome-modules = { module = "com.rometools:rome-modules", version.ref = "rome" }
unirest = { module = "com.mashape.unirest:unirest-java", version = "1.4.9" }

# testImplementation
# testImplementation( "com.github.tomakehurst:wiremock:$wiremockVersion")
# Use standalone b/c of issue "jetty 12 / springboot 3.2 #2395" https://github.com/wiremock/wiremock/issues/2395
wiremock = { module= "com.github.tomakehurst:wiremock-standalone", version="3.0.1"} # 3.0.0-beta-10
wiremock = { module = "com.github.tomakehurst:wiremock-standalone", version = "3.0.1" } # 3.0.0-beta-10


kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-all-open = { module = "org.jetbrains.kotlin:kotlin-allopen", version.ref = "kotlin" }

# bundles? maybe coming soon. maybe not
[bundles]
# Nice ... we can bundle libs and use like "libs.bundles.flyway"
# https://blog.jdriven.com/2022/11/gradle-goodness-grouping-version-catalog-dependencies-into-bundles/
# Bundle with log4j2 dependencies needed to compile.
flyway = ["flyway-core", "flyway-postgresql"]
rome = ["rome-core", "rome-modules"]

0 comments on commit e4b9ad4

Please sign in to comment.