From 2c2c9341d465f1eb6e564156023f7e83c225cd23 Mon Sep 17 00:00:00 2001 From: Roland Asmann Date: Fri, 17 Jan 2025 01:23:49 +0100 Subject: [PATCH] Removed the ability to configure ref and hard-coded it with 'dependsOn' Signed-off-by: Roland Asmann --- docs/ENV.md | 1 - lib/cli/index.js | 12 +++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/docs/ENV.md b/docs/ENV.md index 95ce7943e9..8298848998 100644 --- a/docs/ENV.md +++ b/docs/ENV.md @@ -6,7 +6,6 @@ The following environment variables are available to configure the bom generatio | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | CDXGEN_DEBUG_MODE | Set to `debug` to enable debug messages | | GITHUB_TOKEN | Specify GitHub token to prevent traffic shaping while querying license and repo information | -| MULTI_BOM_COMPONENT_REF | When building a multi-language BOM, choose how the references between the components is handled. This can be useful if other tooling used to eg visualize the dependency-tree only uses 'dependsOn' (as the name dependency-tree more or less implies). Possible values: `dependsOn`, `provides`. Default: `dependesOn`. | | MVN_CMD | Set to override maven command | | MVN_ARGS | Set to pass additional arguments such as profile or settings to maven | | MAVEN_HOME | Specify maven home | diff --git a/lib/cli/index.js b/lib/cli/index.js index fa6643c80d..89c2e2e236 100644 --- a/lib/cli/index.js +++ b/lib/cli/index.js @@ -6506,12 +6506,6 @@ export async function createMultiXBom(pathList, options) { delete parentComponent.components; } // Add references between the multiple sub-boms - // Default is 'provides', but since some tools only generate a tree for 'dependsOn', - // this can be configured with an EnvVar - const multiBomComponentRef = - "provides" === process.env.MULTI_BOM_COMPONENT_REF - ? "provides" - : "dependsOn"; let parentDependencies = dependencies.find( (d) => d["ref"] === parentComponent["bom-ref"], ); @@ -6521,11 +6515,11 @@ export async function createMultiXBom(pathList, options) { }; dependencies = mergeDependencies(dependencies, parentDependencies); } - if (!parentDependencies[multiBomComponentRef]) { - parentDependencies[multiBomComponentRef] = []; + if (!parentDependencies["dependsOn"]) { + parentDependencies["dependsOn"] = []; } for (const parentSub of parentSubComponents) { - parentDependencies[multiBomComponentRef].push(parentSub["bom-ref"]); + parentDependencies["dependsOn"].push(parentSub["bom-ref"]); } } // some cleanup, but not complete