diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 9f75a68dac..e76acc9f77 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -6,17 +6,9 @@ packageRules: [ { enabled: false, - matchPackageNames: [ - 'org.apache.maven:*', - 'org.apache.maven.plugin-tools:*', - ], - }, - { - enabled: false, - matchPackageNames: [ - 'com.palantir.javaformat:palantir-java-format', + matchFileNames: [ + 'gradle/pinned-libs.versions.toml', ], - matchCurrentVersion: '<= 1.1.0', }, { groupName: 'Ktlint', diff --git a/.github/scripts/update_renovate_changelogs.py b/.github/scripts/update_renovate_changelogs.py index 61c64f425c..21698f0307 100755 --- a/.github/scripts/update_renovate_changelogs.py +++ b/.github/scripts/update_renovate_changelogs.py @@ -10,7 +10,7 @@ ("versions", "jackson"): "jackson", ("versions", "ktlint"): "ktlint", ("versions", "javaparser"): "javaparser", - ("libraries", "palantir-java-format-default"): "palantir-java-format", + ("libraries", "palantir-java-format"): "palantir-java-format", ("libraries", "adocfmt"): "adocfmt", ("libraries", "antlr4-formatter"): "antlr4-formatter", ("libraries", "cleanthat-java"): "cleanthat", diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ed432c524e..fd871804cd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,6 @@ jdk-release = "17" durian = "1.2.0" selfie = "3.1.1" jackson = "2.22.2" -maven-api = "3.0" ktlint = "1.8.0" javaparser = "3.28.2" @@ -21,17 +20,13 @@ solstice = "dev.equo.ide:solstice:1.8.2" jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" } jackson-dataformat-yaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "jackson" } -maven-plugin-api = { module = "org.apache.maven:maven-plugin-api", version.ref = "maven-api" } -maven-plugin-annotations = { module = "org.apache.maven.plugin-tools:maven-plugin-annotations", version.ref = "maven-api" } -maven-core = { module = "org.apache.maven:maven-core", version.ref = "maven-api" } - ktlint-rule-engine = { module = "com.pinterest.ktlint:ktlint-rule-engine", version.ref = "ktlint" } ktlint-ruleset-standard = { module = "com.pinterest.ktlint:ktlint-ruleset-standard", version.ref = "ktlint" } javaparser-core = { module = "com.github.javaparser:javaparser-core", version.ref = "javaparser" } javaparser-symbol-solver-core = { module = "com.github.javaparser:javaparser-symbol-solver-core", version.ref = "javaparser" } -palantir-java-format-default = "com.palantir.javaformat:palantir-java-format:2.98.0" +palantir-java-format = "com.palantir.javaformat:palantir-java-format:2.98.0" jgit = "org.eclipse.jgit:org.eclipse.jgit:7.8.0.202609011348-r" junit-jupiter = "org.junit.jupiter:junit-jupiter:6.1.3" @@ -42,10 +37,8 @@ slf4j-api = "org.slf4j:slf4j-api:2.0.19" jsr305 = "com.google.code.findbugs:jsr305:3.0.2" jcip-annotations = "net.jcip:jcip-annotations:1.0" jakarta-annotation-api = "jakarta.annotation:jakarta.annotation-api:3.0.0" -aether-api = "org.eclipse.aether:aether-api:1.1.0" plexus-resources = "org.codehaus.plexus:plexus-resources:1.4.0" plexus-utils = "org.codehaus.plexus:plexus-utils:4.1.0" -plexus-build-api = "org.sonatype.plexus:plexus-build-api:0.0.7" concurrent-trees = "com.googlecode.concurrent-trees:concurrent-trees:2.6.1" owasp-encoder = "org.owasp.encoder:encoder:1.4.0" mustache-compiler = "com.github.spullara.mustache.java:compiler:0.9.14" @@ -53,7 +46,6 @@ adocfmt = "org.drjekyll:adocfmt:0.3.1" antlr4-formatter = "com.khubla.antlr4formatter:antlr4-formatter:1.2.1" cleanthat-java = "io.github.solven-eu.cleanthat:java:2.26" cool-rdf-formatter = "cool.rdf:cool-rdf-formatter:2.0.1" -diktat-rules = "org.cqfn.diktat:diktat-rules:1.2.5" diktat-runner = "com.saveourtool.diktat:diktat-runner:2.0.0" flexmark-all = "com.vladsch.flexmark:flexmark-all:0.64.8" freshmark = "com.diffplug.freshmark:freshmark:1.3.1" @@ -62,7 +54,6 @@ google-java-format = "com.google.googlejavaformat:google-java-format:1.30.0" gson = "com.google.code.gson:gson:2.14.0" json-simple = "org.json:json:20210307" ktfmt = "com.facebook:ktfmt:0.64" -palantir-java-format = "com.palantir.javaformat:palantir-java-format:1.1.0" prince-of-space-core = "io.github.agustafson.princeofspace:prince-of-space-core:2.2.0" scalafmt-core = "org.scalameta:scalafmt-core_2.13:3.8.1" sortpom-sorter = "com.github.ekryd.sortpom:sortpom-sorter:4.0.0" diff --git a/gradle/pinned-libs.versions.toml b/gradle/pinned-libs.versions.toml new file mode 100644 index 0000000000..8d3cae34c2 --- /dev/null +++ b/gradle/pinned-libs.versions.toml @@ -0,0 +1,17 @@ +# This version catalog contains pinned/locked dependencies (e.g. for backward-compatibility +# compile targets or fixed build tool APIs). Automated dependency updates (like Renovate) +# are explicitly disabled for this file. + +[versions] +maven = "3.0" + +[libraries] +maven-plugin-api = { module = "org.apache.maven:maven-plugin-api", version.ref = "maven" } +maven-plugin-annotations = { module = "org.apache.maven.plugin-tools:maven-plugin-annotations", version.ref = "maven" } +maven-core = { module = "org.apache.maven:maven-core", version.ref = "maven" } + +palantir-java-format = "com.palantir.javaformat:palantir-java-format:1.1.0" +google-java-format = "com.google.googlejavaformat:google-java-format:1.7" +diktat-rules = "org.cqfn.diktat:diktat-rules:1.2.5" +aether-api = "org.eclipse.aether:aether-api:1.1.0" +plexus-build-api = "org.sonatype.plexus:plexus-build-api:0.0.7" diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index f5b6e93ef2..e552219f58 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -22,7 +22,7 @@ buildConfig { buildConfigField("VERSION_CLEANTHAT", libs.cleanthat.java.version) buildConfigField("VERSION_GJF", libs.google.java.format.version) buildConfigField("VERSION_JAVAPARSER", libs.javaparser.symbol.solver.core.version) - buildConfigField("VERSION_PALANTIR_JAVA_FORMAT", libs.palantir.java.format.default.version) + buildConfigField("VERSION_PALANTIR_JAVA_FORMAT", libs.palantir.java.format.version) buildConfigField("VERSION_PRINCE_OF_SPACE", libs.prince.of.space.core.version) buildConfigField("VERSION_TABLETEST_FORMATTER", libs.tabletest.formatter.core.version) @@ -142,7 +142,7 @@ dependencies { "cleanthatCompileOnly"(libs.cleanthat.java) "compatCleanthat2Dot1CompileAndTestOnly"(libs.cleanthat.java) // diktat old supported version 1.x - "compatDiktat1Dot2Dot5CompileOnly"(libs.diktat.rules) + "compatDiktat1Dot2Dot5CompileOnly"(pinnedLibs.diktat.rules) // diktat latest supported version 2.x "compatDiktat2Dot0Dot0CompileOnly"(libs.diktat.runner) // flexmark @@ -161,11 +161,7 @@ dependencies { "javaParserCompileOnly"(libs.javaparser.symbol.solver.core) // ktfmt "ktfmtCompileOnly"(libs.ktfmt) - "ktfmtCompileOnly"("com.google.googlejavaformat:google-java-format") { - version { - strictly("1.7") // for JDK 8 compatibility - } - } + "ktfmtCompileOnly"(pinnedLibs.google.java.format) // for JDK 8 compatibility "ktfmtCompileOnly"(libs.jsr305) // ktlint latest supported version "compatKtLint1Dot0Dot0CompileAndTestOnly"(libs.ktlint.rule.engine) @@ -173,7 +169,7 @@ dependencies { "compatKtLint1Dot0Dot0CompileAndTestOnly"(libs.slf4j.api) // palantirJavaFormat "palantirJavaFormatCompileOnly"( - libs.palantir.java.format + pinnedLibs.palantir.java.format ) // this version needs to stay compilable against Java 8 for CI Job testNpm // princeOfSpace "princeOfSpaceCompileOnly"(libs.prince.of.space.core) diff --git a/plugin-maven/build.gradle.kts b/plugin-maven/build.gradle.kts index 30d9fba106..0b467292f0 100644 --- a/plugin-maven/build.gradle.kts +++ b/plugin-maven/build.gradle.kts @@ -36,10 +36,10 @@ dependencies { implementation(projects.lib) implementation(projects.libExtra) - compileOnly(libs.maven.plugin.api) - compileOnly(libs.maven.plugin.annotations) - compileOnly(libs.maven.core) - compileOnly(libs.aether.api) + compileOnly(pinnedLibs.maven.plugin.api) + compileOnly(pinnedLibs.maven.plugin.annotations) + compileOnly(pinnedLibs.maven.core) + compileOnly(pinnedLibs.aether.api) compileOnly(libs.jakarta.annotation.api) @@ -49,7 +49,7 @@ dependencies { implementation(libs.plexus.resources) implementation(libs.plexus.utils) implementation(libs.jgit) - implementation(libs.plexus.build.api) + implementation(pinnedLibs.plexus.build.api) testImplementation(projects.testlib) testImplementation(libs.junit.jupiter) @@ -58,10 +58,10 @@ dependencies { testImplementation(libs.durian.io) testImplementation(libs.mustache.compiler) testImplementation(libs.owasp.encoder) - testImplementation(libs.maven.plugin.api) - testImplementation(libs.aether.api) + testImplementation(pinnedLibs.maven.plugin.api) + testImplementation(pinnedLibs.aether.api) testImplementation(libs.plexus.resources) - testImplementation(libs.maven.core) + testImplementation(pinnedLibs.maven.core) testRuntimeOnly("org.junit.platform:junit-platform-launcher") } diff --git a/settings.gradle.kts b/settings.gradle.kts index 87d6ba6a36..fdc141eeca 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,6 +18,11 @@ dependencyResolutionManagement { repositories { mavenCentral() } + versionCatalogs { + create("pinnedLibs") { + from(files("gradle/pinned-libs.versions.toml")) + } + } } if (System.getenv("CI") != null) {