From c866fd7204effe103aa61625b81051ab2d9744f7 Mon Sep 17 00:00:00 2001 From: Jose Luis Leon Date: Sun, 17 Sep 2023 21:03:46 -0500 Subject: [PATCH] chore(deps): Use Gradle version catalog (#207) --- build.gradle | 19 ++++++++++--------- gradle.lockfile | 4 ++-- settings.gradle | 16 ++++++++++++++++ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index d45ec71..92503d3 100644 --- a/build.gradle +++ b/build.gradle @@ -58,7 +58,7 @@ jar { } sonarLint { - setToolVersion('9.2.0.74516') + setToolVersion(libs.versions.sonarlint.core.get()) languages { include('java') } @@ -80,13 +80,14 @@ strictNullCheck { javadoc = """\ @author Jose Luis Leon @since v1.0.2 - """.stripIndent() + """ + .stripIndent() } source.addEclipse() } checkstyle { - setToolVersion('10.12.3') + setToolVersion(libs.versions.checkstyle.get()) } dependencyLocking { @@ -98,9 +99,9 @@ repositories { } dependencies { - sonarlintCorePlugins('org.sonarsource.java:sonar-java-plugin:7.24.0.32100') + sonarlintCorePlugins(libs.sonarlint.java) constraints { - sonarlintCore('org.apache.tomcat.embed:tomcat-embed-core:9.0.80') { + sonarlintCore(libs.tomcat.jasper) { because('version 9.0.75 has a security vulnerability') } } @@ -109,10 +110,10 @@ dependencies { testing { suites { test { - useJUnitJupiter('5.10.0') + useJUnitJupiter(libs.versions.junit.get()) dependencies { - implementation('org.assertj:assertj-core:3.24.2') - implementation('org.mockito:mockito-core:5.5.0') + implementation(libs.assertj) + implementation(libs.mockito) } } } @@ -126,7 +127,7 @@ prettyJupiter { } jacoco { - toolVersion('0.8.10') + setToolVersion(libs.versions.jacoco.get()) } jacocoTestReport { diff --git a/gradle.lockfile b/gradle.lockfile index 5d85cd0..07561a8 100644 --- a/gradle.lockfile +++ b/gradle.lockfile @@ -35,8 +35,8 @@ org.apache.maven.doxia:doxia-logging-api:1.12.0=checkstyle org.apache.maven.doxia:doxia-module-xdoc:1.12.0=checkstyle org.apache.maven.doxia:doxia-sink-api:1.12.0=checkstyle org.apache.tomcat.embed:tomcat-embed-core:9.0.80=sonarlintCoreClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.75=sonarlintCoreClasspath -org.apache.tomcat.embed:tomcat-embed-jasper:9.0.75=sonarlintCoreClasspath +org.apache.tomcat.embed:tomcat-embed-el:9.0.80=sonarlintCoreClasspath +org.apache.tomcat.embed:tomcat-embed-jasper:9.0.80=sonarlintCoreClasspath org.apache.tomcat:tomcat-annotations-api:9.0.80=sonarlintCoreClasspath org.apache.xbean:xbean-reflect:3.7=checkstyle org.apiguardian:apiguardian-api:1.1.2=java17TestCompileClasspath,java20TestCompileClasspath,testCompileClasspath diff --git a/settings.gradle b/settings.gradle index 4eeee55..e221665 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,3 +3,19 @@ plugins { } rootProject.name = 'maybe' + +dependencyResolutionManagement { + versionCatalogs { + libs { + version('checkstyle', '10.12.3') + version('jacoco', '0.8.10') + version('junit', '5.10.0') + version('sonarlint-core', '9.2.0.74516') + + library('assertj', 'org.assertj', 'assertj-core').version('3.24.2') + library('mockito', 'org.mockito', 'mockito-core').version('5.5.0') + library('sonarlint-java', 'org.sonarsource.java', 'sonar-java-plugin').version('7.24.0.32100') + library('tomcat-jasper', 'org.apache.tomcat.embed', 'tomcat-embed-jasper').version('9.0.80') + } + } +}