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 e4b9ad4 commit 6c26ac5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 32 deletions.
4 changes: 2 additions & 2 deletions kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ java.sourceCompatibility = JavaVersion.VERSION_17

plugins {
val kotlinVersion = libs.versions.kotlin.get()
// 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 @@ -37,7 +36,8 @@ plugins {
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
// id("org.sonarqube") version "4.3.1.3277" // new ones may cause issues against sonarcloud.io, so test first
alias(libs.plugins.sonarqube)

kotlin("jvm") version kotlinVersion
kotlin("plugin.spring") version kotlinVersion
Expand Down
15 changes: 1 addition & 14 deletions kotlin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
# 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.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.kotlinVersion=1.9.20
systemProp.mockitoInlineVersion=4.11.0
#systemProp.postgresVersion=42.6.0
#systemProp.romeVersion=1.19.0
#systemProp.springBootVersion=3.1.3
#systemProp.unirestVersion=1.4.9
#systemProp.versionsVersion=0.47.0
#systemProp.wiremockVersion=3.0.0-beta-10

# enable to support incremental processing
# https://medium.com/@daniel_novak/making-incremental-kapt-work-speed-up-your-kotlin-projects-539db1a771cf
kapt.incremental.apt=false

# Not needed if daemon is enabled, see https://github.com/gradle/gradle/issues/17493
# Not needed if daemon is enabled, see https://github.com/gradle/gradle/issues/17493
# org.gradle.jvmargs=--add-opens java.base/java.util=ALL-UNNAMED

# try to fix OOM on recent GitHub Actions https://community.sonarsource.com/t/metaspace-oom-after-upgrade-to-9-9/85105
Expand Down
31 changes: 15 additions & 16 deletions kotlin/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# File: gradle/libs.versions.toml
# Gradle Goodness: Defining Plugin Versions Using Version Catalog
# File: gradle/libs.versions.toml "Gradle version catalogs for an awesome dependency management"
#
# * https://proandroiddev.com/gradle-version-catalogs-for-an-awesome-dependency-management-f2ba700ff894
# * https://blog.jdriven.com/2022/11/gradle-goodness-defining-plugin-versions-using-version-catalog/
# * https://medium.com/@vladyslav.hontar/dependabot-in-action-d9b56b2be86c
# * https://blog.jdriven.com/2022/11/gradle-goodness-grouping-version-catalog-dependencies-into-bundles/
# * https://proandroiddev.com/gradle-version-catalogs-for-an-awesome-dependency-management-f2ba700ff894 (Gradle version catalogs for an awesome dependency management)
# * https://medium.com/@vladyslav.hontar/dependabot-in-action-d9b56b2be86c (How to use Dependabot with Gradle’s Version Catalog)
# * https://blog.jdriven.com/2022/11/gradle-goodness-defining-plugin-versions-using-version-catalog/ (Gradle Goodness: Defining Plugin Versions Using Version Catalog)
# * https://blog.jdriven.com/2022/11/gradle-goodness-grouping-version-catalog-dependencies-into-bundles/ (Gradle Goodness: Grouping Version Catalog Dependencies Into Bundles)
#
# "We can replace these plugin references with version catalog defined values. First we must create the file
# gradle/libs.version.toml in our project directory. We might already have such file with definitions for the
# dependencies we use in our build and tests. Next we must add a section [plugins] where we can define our plugin
# dependencies. We can use the full power of the version catalog here, the only thing we need to remember is to use the
# dependencies we use in our build and tests.
# Next we must add a section [plugins] where we can define our plugin dependencies.
# We can use the full power of the version catalog here, the only thing we need to remember is to use the
# id property of we use the longer notation option. With the shorthand notation we can simply define a string value
# with the id of the plugin, a colon : and the version."
#
Expand All @@ -20,25 +20,25 @@
# Versions is used to declare the version numbers that will be referenced later by plugins and libraries.
# can be used as version.ref in [plugins] and [libraries] section, see flyway-core example below
flyway = "10.4.1"
jacoco = "0.8.11"
jacoco = "0.8.11" # used like "toolVersion = libs.versions.jacoco.get()" in jacoco block
kotlin = "1.9.22"
postgresql = "42.7.1"
rome = "1.19.0"
spring-boot = "3.2.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.
# We can use the longer notation option where we set the id and version for the plugin.
spring-boot = { id = "org.springframework.boot", version.ref = "spring-boot" } # 3.1.5
spring-dep-mgmt = { id = "io.spring.dependency-management", version = "1.1.4" }
sonarqube = { id = "org.sonarqube", version = "4.4.1.3373" } # new "4.3.1.3277" -> 4.4.1.3373"

# Here we use the longer notation and version.ref to reference
# the version defined in the [versions] section.
# Here we use the longer notation and version.ref to reference an entry from the [versions] section.
flyway-plugin = { id = "org.flywaydb.flyway", version.ref = "flyway" }

[libraries]
Expand All @@ -61,14 +61,13 @@ hypersistence-utils-hibernate = { module = "io.hypersistence:hypersistence-utils

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


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" }

Expand Down

0 comments on commit 6c26ac5

Please sign in to comment.