This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new a0c686fef97 Explicit version alignment between gradle configurations
(#4140)
a0c686fef97 is described below
commit a0c686fef976aaac47150313fb8a8e377ca466f4
Author: Jan Høydahl <[email protected]>
AuthorDate: Fri Feb 20 21:39:38 2026 +0100
Explicit version alignment between gradle configurations (#4140)
These gradle changes ensure that *one* version of each library is chosen.
It will align the compile, runtime, runtimeLibs and solrPlatformLibs.
This gives less risk of drift, and more often let BOM decide effective
version chosen
---
changelog/unreleased/PR#4140-gradle-sync-versions.yml | 11 +++++++++++
gradle/solr/packaging.gradle | 5 +++++
gradle/validation/dependencies.gradle | 15 +++++++++++++++
gradle/validation/jar-checks.gradle | 4 ++++
solr/cross-dc-manager/gradle.lockfile | 6 ++----
solr/licenses/grpc-api-1.70.0.jar.sha1 | 1 -
.../netty-tcnative-boringssl-static-2.0.73.Final.jar.sha1 | 1 -
.../licenses/netty-tcnative-classes-2.0.73.Final.jar.sha1 | 1 -
solr/modules/gcs-repository/gradle.lockfile | 3 +--
solr/modules/opentelemetry/gradle.lockfile | 6 ++----
solr/modules/s3-repository/gradle.lockfile | 4 ++--
11 files changed, 42 insertions(+), 15 deletions(-)
diff --git a/changelog/unreleased/PR#4140-gradle-sync-versions.yml
b/changelog/unreleased/PR#4140-gradle-sync-versions.yml
new file mode 100644
index 00000000000..ede61692caa
--- /dev/null
+++ b/changelog/unreleased/PR#4140-gradle-sync-versions.yml
@@ -0,0 +1,11 @@
+title: Gradle now syncs dependency versions across more configurations,
forcing the choosing of one version in most cases
+type: other
+authors:
+ - name: Jan Høydahl
+ - name: David Smiley
+ - name: Christos Malliaridis
+links:
+ - name: PR#4140
+ url: https://github.com/apache/solr/pull/4140
+
+
diff --git a/gradle/solr/packaging.gradle b/gradle/solr/packaging.gradle
index d1706b4c577..54823d80f0f 100644
--- a/gradle/solr/packaging.gradle
+++ b/gradle/solr/packaging.gradle
@@ -55,6 +55,11 @@ configure(allprojects
packaging
}
+ // Align packaging configurations with tested runtimeClasspath versions
+ // This ensures the distribution contains the same library versions that
were tested
+ alignWithRuntimeClasspath(configurations.runtimeLibs)
+ alignWithRuntimeClasspath(configurations.solrPlatformLibs)
+
dependencies {
solrPlatformLibs project(":solr:core")
solrPlatformLibs project(":solr:solrj")
diff --git a/gradle/validation/dependencies.gradle
b/gradle/validation/dependencies.gradle
index 87c00ae2ed7..73767e4ad95 100644
--- a/gradle/validation/dependencies.gradle
+++ b/gradle/validation/dependencies.gradle
@@ -41,6 +41,21 @@ allprojects {
ignoredDependencies.add("org.jetbrains.skiko:skiko-awt-runtime-*")
}
+ // Configure consistent dependency resolution across configurations
+ plugins.withType(JavaPlugin) {
+ project.java {
+ consistentResolution {
+ useCompileClasspathVersions()
+ }
+ }
+ }
+
+ // Helper to align a configuration to use the same dependency versions as
runtimeClasspath.
+ // This ensures that packaging/distribution and validation use the same
versions that were tested.
+ ext.alignWithRuntimeClasspath = { Configuration conf ->
+ conf.shouldResolveConsistentlyWith(project.configurations.runtimeClasspath)
+ }
+
dependencies {
modules {
module("org.hamcrest:hamcrest-core") {
diff --git a/gradle/validation/jar-checks.gradle
b/gradle/validation/jar-checks.gradle
index b0c97bb5158..152bc476ad7 100644
--- a/gradle/validation/jar-checks.gradle
+++ b/gradle/validation/jar-checks.gradle
@@ -91,6 +91,10 @@ subprojects {
extendsFrom testCompileClasspath
}
}
+
+ // Align jarValidation with tested runtimeClasspath versions
+ // This ensures validation uses the same versions that were tested
+ alignWithRuntimeClasspath(configurations.jarValidation)
}
// Collects dependency JAR information for a project and saves it in
diff --git a/solr/cross-dc-manager/gradle.lockfile
b/solr/cross-dc-manager/gradle.lockfile
index ca8999d0c32..a020c9f7bef 100644
--- a/solr/cross-dc-manager/gradle.lockfile
+++ b/solr/cross-dc-manager/gradle.lockfile
@@ -77,10 +77,8 @@
io.netty:netty-common:4.2.6.Final=compileClasspath,jarValidation,runtimeClasspat
io.netty:netty-handler-proxy:4.2.6.Final=jarValidation,runtimeClasspath,runtimeLibs,testRuntimeClasspath
io.netty:netty-handler:4.2.6.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
io.netty:netty-resolver:4.2.6.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
-io.netty:netty-tcnative-boringssl-static:2.0.70.Final=compileClasspath,solrPlatformLibs,testCompileClasspath
-io.netty:netty-tcnative-boringssl-static:2.0.73.Final=jarValidation,runtimeClasspath,runtimeLibs,testRuntimeClasspath
-io.netty:netty-tcnative-classes:2.0.70.Final=compileClasspath,solrPlatformLibs,testCompileClasspath
-io.netty:netty-tcnative-classes:2.0.73.Final=jarValidation,runtimeClasspath,runtimeLibs,testRuntimeClasspath
+io.netty:netty-tcnative-boringssl-static:2.0.70.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
+io.netty:netty-tcnative-classes:2.0.70.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
io.netty:netty-transport-classes-epoll:4.2.6.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
io.netty:netty-transport-native-epoll:4.2.6.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
io.netty:netty-transport-native-unix-common:4.2.6.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
diff --git a/solr/licenses/grpc-api-1.70.0.jar.sha1
b/solr/licenses/grpc-api-1.70.0.jar.sha1
deleted file mode 100644
index 7897ebe6e39..00000000000
--- a/solr/licenses/grpc-api-1.70.0.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-c0d185f8435e2dbc9b0f430d1e89600858ee24ee
diff --git
a/solr/licenses/netty-tcnative-boringssl-static-2.0.73.Final.jar.sha1
b/solr/licenses/netty-tcnative-boringssl-static-2.0.73.Final.jar.sha1
deleted file mode 100644
index 0bea976dc34..00000000000
--- a/solr/licenses/netty-tcnative-boringssl-static-2.0.73.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-de7380a74a7611e9937dd2106abfde5b405dbd15
diff --git a/solr/licenses/netty-tcnative-classes-2.0.73.Final.jar.sha1
b/solr/licenses/netty-tcnative-classes-2.0.73.Final.jar.sha1
deleted file mode 100644
index 048e8b91eba..00000000000
--- a/solr/licenses/netty-tcnative-classes-2.0.73.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-f50d875a46e4a7768f35dbc26fb796fd791b8b09
diff --git a/solr/modules/gcs-repository/gradle.lockfile
b/solr/modules/gcs-repository/gradle.lockfile
index 12be94a7176..5587144fc86 100644
--- a/solr/modules/gcs-repository/gradle.lockfile
+++ b/solr/modules/gcs-repository/gradle.lockfile
@@ -69,8 +69,7 @@
io.dropwizard.metrics:metrics-jetty12:4.2.26=jarValidation,testRuntimeClasspath
io.github.eisop:dataflow-errorprone:3.41.0-eisop1=annotationProcessor,errorprone,testAnnotationProcessor
io.github.java-diff-utils:java-diff-utils:4.12=annotationProcessor,errorprone,testAnnotationProcessor
io.grpc:grpc-alts:1.65.1=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
-io.grpc:grpc-api:1.65.1=compileClasspath,testCompileClasspath
-io.grpc:grpc-api:1.70.0=jarValidation,runtimeClasspath,runtimeLibs,testRuntimeClasspath
+io.grpc:grpc-api:1.65.1=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
io.grpc:grpc-auth:1.65.1=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
io.grpc:grpc-bom:1.65.1=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
io.grpc:grpc-context:1.70.0=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
diff --git a/solr/modules/opentelemetry/gradle.lockfile
b/solr/modules/opentelemetry/gradle.lockfile
index 5212ab9c137..134b041b4aa 100644
--- a/solr/modules/opentelemetry/gradle.lockfile
+++ b/solr/modules/opentelemetry/gradle.lockfile
@@ -65,10 +65,8 @@
io.netty:netty-common:4.2.6.Final=compileClasspath,jarValidation,runtimeClasspat
io.netty:netty-handler-proxy:4.2.6.Final=jarValidation,runtimeClasspath,runtimeLibs,testRuntimeClasspath
io.netty:netty-handler:4.2.6.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
io.netty:netty-resolver:4.2.6.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
-io.netty:netty-tcnative-boringssl-static:2.0.70.Final=solrPlatformLibs
-io.netty:netty-tcnative-boringssl-static:2.0.73.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
-io.netty:netty-tcnative-classes:2.0.70.Final=solrPlatformLibs
-io.netty:netty-tcnative-classes:2.0.73.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
+io.netty:netty-tcnative-boringssl-static:2.0.73.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
+io.netty:netty-tcnative-classes:2.0.73.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
io.netty:netty-transport-classes-epoll:4.2.6.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
io.netty:netty-transport-native-epoll:4.2.6.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
io.netty:netty-transport-native-unix-common:4.2.6.Final=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
diff --git a/solr/modules/s3-repository/gradle.lockfile
b/solr/modules/s3-repository/gradle.lockfile
index d5527e8ea27..4ca58b62f6f 100644
--- a/solr/modules/s3-repository/gradle.lockfile
+++ b/solr/modules/s3-repository/gradle.lockfile
@@ -21,8 +21,8 @@
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.1=jarValidation,test
com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations:2.20.1=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
com.fasterxml.jackson.module:jackson-module-parameter-names:2.20.1=jarValidation,testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson:jackson-bom:2.20.1=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
-com.fasterxml.woodstox:woodstox-core:7.0.0=apiHelper,runtimeClasspath,runtimeLibs,solrPlatformLibs
-com.fasterxml.woodstox:woodstox-core:7.1.1=jarValidation,testCompileClasspath,testRuntimeClasspath
+com.fasterxml.woodstox:woodstox-core:7.0.0=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs
+com.fasterxml.woodstox:woodstox-core:7.1.1=testCompileClasspath,testRuntimeClasspath
com.github.ben-manes.caffeine:caffeine:3.2.2=annotationProcessor,apiHelper,errorprone,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testAnnotationProcessor,testRuntimeClasspath
com.github.kevinstern:software-and-algorithms:1.0=annotationProcessor,errorprone,testAnnotationProcessor
com.google.auto.service:auto-service-annotations:1.0.1=annotationProcessor,errorprone,testAnnotationProcessor