From f00b1b1adde46c3b1273bd818aba2f8068a135af Mon Sep 17 00:00:00 2001 From: Christian Bush Date: Sun, 21 Jun 2026 21:26:53 -0700 Subject: [PATCH] Filter all-modules aggregate to only published modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The all-modules aggregate referenced every leaf module, including client/common — a codegen-only helper consumed at build time via `apply from:` that is never published to Maven. ELR reads the all-modules POM and walks its dependencies transitively to mirror artifacts into the internal artifactory, so referencing an unpublished coordinate breaks the mirror (and collides on artifactId `common` with the published services/common). Restrict the aggregate to leaf modules that apply maven-publish, so the published POM lists only resolvable coordinates. The member list now tracks publish status automatically: a module that stops publishing drops out of the POM with no manual upkeep. Kept as a real-dependency aggregate, not a BOM — ELR walks , and a BOM's lazy would leave nothing to mirror. --- all-modules/build.gradle | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/all-modules/build.gradle b/all-modules/build.gradle index dec72f0e6..b61a497aa 100644 --- a/all-modules/build.gradle +++ b/all-modules/build.gradle @@ -3,12 +3,30 @@ plugins { id 'openhouse.maven-publish' } -// This module depends on all other OpenHouse modules. Its primary purpose is to allow downstream -// consumers to track a single artifact in ELR instead of enumerating every module individually. -dependencies { - rootProject.subprojects.each { subproject -> - if (subproject.path != project.path && subproject.subprojects.isEmpty()) { - implementation project(subproject.path) +// `all-modules` aggregates every PUBLISHED OpenHouse module as a real (compile/runtime) dependency, so +// its published POM lists every OpenHouse coordinate under . Downstream ELR tooling reads +// this single coordinate's POM, walks those dependencies transitively, and mirrors the full artifact +// set into the internal artifactory — instead of enumerating every module by hand. +// +// This MUST stay a real-dependency aggregate, NOT a BOM. A BOM publishes only lazy +// constraints, which ELR has nothing to walk, so the mirror would come up empty. +// +// Only leaf modules that actually apply maven-publish are included. Referencing an unpublished module +// (e.g. the codegen-only client:common, which is consumed at build time via `apply from:` and never +// published) would point the aggregate POM at a coordinate ELR cannot resolve and break the mirror. +// Each candidate leaf is evaluated first so its plugin state is known before we decide to depend on it. +def publishedMembers = [] +rootProject.subprojects.each { subproject -> + if (subproject.path != project.path && subproject.subprojects.isEmpty()) { + evaluationDependsOn(subproject.path) + if (subproject.pluginManager.hasPlugin('maven-publish')) { + publishedMembers << subproject } } } + +dependencies { + publishedMembers.each { member -> + implementation project(member.path) + } +}