This is an automated email from the ASF dual-hosted git repository.
engelen pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 87748ed170 Build Reliability Upgrade: Cross-project runtimeClasspath
resolution in geode-java.gradle (#7925)
87748ed170 is described below
commit 87748ed17020f12c36c147120632dae25a2a378d
Author: Jinwoo Hwang <[email protected]>
AuthorDate: Fri Oct 24 07:02:18 2025 -0400
Build Reliability Upgrade: Cross-project runtimeClasspath resolution in
geode-java.gradle (#7925)
* Cross-project runtimeClasspath resolution
* Add logging for dependencies without version information in the JAR
manifest generation process
---
.../scripts/src/main/groovy/geode-java.gradle | 27 ++++++++++++++++------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/build-tools/scripts/src/main/groovy/geode-java.gradle
b/build-tools/scripts/src/main/groovy/geode-java.gradle
index 34aff82cc2..148309f02b 100644
--- a/build-tools/scripts/src/main/groovy/geode-java.gradle
+++ b/build-tools/scripts/src/main/groovy/geode-java.gradle
@@ -123,13 +123,26 @@ gradle.taskGraph.whenReady({ graph ->
}.findAll { !(it.value?.hasProperty('optional') &&
it.value.optional)})
}
- def incoming =
geodeProject.configurations.runtimeClasspath.getIncoming()
- def resolutionResult = incoming.getResolutionResult()
- def components = resolutionResult.allComponents
-
- upstreamDeps.addAll(components.findAll {componentResult ->
- depMap.containsKey(componentResult.moduleVersion.id.name)
- }.collect {it.moduleVersion.id.name + '-' + it.moduleVersion.version +
'.jar'})
+ // NOTE: Previously this logic resolved the upstream project's
runtimeClasspath via
+ //
geodeProject.configurations.runtimeClasspath.getIncoming().getResolutionResult().
+ // That constitutes cross-project configuration resolution (executed
while configuring
+ // the current project's Jar task) and triggers Gradle's deprecation
warning:
+ // "Resolution of the configuration :otherProject:runtimeClasspath
was attempted from a context different than the project context"
+ // To avoid that, we derive the first-level runtime dependency jar
names directly from
+ // the dependency metadata (depMap) we already collected, without
forcing resolution of
+ // the upstream configuration here. This yields the same set that was
formerly filtered
+ // against the resolved components because depMap only contains
declared (first-level)
+ // non-optional dependencies of the upstream project.
+ depMap.values()
+ .findAll { dep -> !(dep instanceof ProjectDependency) }
+ .each { dep ->
+ if (dep.hasProperty('version') && dep.version) {
+ upstreamDeps.add("${dep.name}-${dep.version}.jar")
+ } else {
+ // Log warning about missing version but don't add to
upstreamDeps (preserves original behavior)
+ logger.warn("Dependency '${dep.name}' has no version information
in project '${geodeProject.name}' and will be skipped from upstream exclusion")
+ }
+ }
}
// TODO: can we put our projects on the ClassPath line still?
runtimeSet.removeAll(upstreamDeps)