如何在子模块中生成 SBOM 并获得聚合的 SBOM?自 2.7.4 起使用 makeAggregateBom 进行回归 - outputReactorProjects 不起作用

How can I generate SBOM in sub-module and get an aggregated SBOM? Regression with makeAggregateBom since 2.7.4 - outputReactorProjects has no effect

提问人:bendwe 提问时间:8/29/2023 更新时间:8/29/2023 访问量:126

问:

我有一个多模块 maven 项目,我想在每个模块上创建一个 SBOM,并使用 cyclonedx-maven-plugin 在根文件夹上获取聚合 BOM。

当我执行以下命令时:

mvn clean install org.cyclonedx:cyclonedx-maven-plugin:2.7.2:makeAggregateBom -DoutputReactorProjects=true -DoutputFormat=xml -B

我在根目标文件夹上有一个聚合 BOM,每个模块中都有一个 BOM。这是预期的行为。 在某些情况下,如果需要,我会将属性“outputReactorProjects”设置为 false,以便仅获取根目标文件夹上的聚合 bom。

从 2.7.4 开始,属性“outputReactorProjects”不起作用,如果我使用“makeAggregateBom”目标,我永远不会在模块内获得 BOM。就像如果属性设置为 false ( https://cyclonedx.github.io/cyclonedx-maven-plugin/makeAggregateBom-mojo.html#outputReactorProjects )

在文档化之后,我们仍然可以在子模块内生成一个聚合 BOM 和一个 BOM:“makeAggregateBom:在构建根目录下创建一个聚合 BOM(包含来自整个多模块构建的依赖项),并最终为每个模块创建一个 BOM”

使用 Maven 3.8.5 和 Maven 3.9.0、插件版本 2.7.4、2.7.5 和 2.7.9 重现案例。

我尝试了这些命令:

mvn clean install org.cyclonedx:cyclonedx-maven-plugin:2.7.2:makeAggregateBom -DoutputReactorProjects=true -DoutputFormat=xml -B

--->根 SBOM 和子模块

mvn clean install org.cyclonedx:cyclonedx-maven-plugin:2.7.2:makeAggregateBom -DoutputReactorProjects=false -DoutputFormat=xml -B

仅--->根 SBOM

mvn clean install org.cyclonedx:cyclonedx-maven-plugin:2.7.4:makeAggregateBom -DoutputReactorProjects=true -DoutputFormat=xml -B

仅--->根 SBOM

mvn clean install org.cyclonedx:cyclonedx-maven-plugin:2.7.4:makeAggregateBom -DoutputReactorProjects=false -DoutputFormat=xml -B

仅--->根 SBOM

mvn clean install org.cyclonedx:cyclonedx-maven-plugin:2.7.9:makeAggregateBom -DoutputReactorProjects=true -DoutputFormat=xml -B

仅--->根 SBOM

mvn clean install org.cyclonedx:cyclonedx-maven-plugin:2.7.9:makeAggregateBom -DoutputReactorProjects=false -DoutputFormat=xml -B

maven-plugin owasp 字节顺序标记 cyclonedx

评论


答: 暂无答案