Skip to content

CM-59712: add --maven-settings-file to report sbom path command#385

Merged
gotbadger merged 2 commits intocycodehq:mainfrom
ronens88:CM-59712/add-maven-settings-to-report-sbom
Feb 18, 2026
Merged

CM-59712: add --maven-settings-file to report sbom path command#385
gotbadger merged 2 commits intocycodehq:mainfrom
ronens88:CM-59712/add-maven-settings-to-report-sbom

Conversation

@ronens88
Copy link
Contributor

@ronens88 ronens88 commented Feb 16, 2026

Summary

  • Add --maven-settings-file option to report sbom path command so Maven projects can use a custom settings.xml when generating SBOM reports locally
  • Update README to document the new option under the Local Project SBOM section

Why this works

The report sbom path command already runs the same local dependency restore pipeline as scan -t sca path via add_sca_dependencies_tree_documents_if_needed(). The Maven restore handler (RestoreMavenDependencies) reads ctx.obj.get('maven_settings_file') to append -s <path> to the mvn command — this change simply populates that key from a new CLI option.

Call chain:

  1. app callback → ctx.ensure_object(dict) initializes ctx.obj
  2. report_command callback → sets progress_bar
  3. sbom_command callback → sets report_parameters, output_file
  4. path_command → sets ctx.obj['maven_settings_file'] (this PR)
  5. add_sca_dependencies_tree_documents_if_needed() → checks no_restore (defaults False), calls _add_dependencies_tree_documents()
  6. RestoreMavenDependencies.get_commands() → reads self.ctx.obj.get('maven_settings_file'), appends -s <path> to mvn cyclonedx:makeAggregateBom
  7. RestoreMavenDependencies.create_secondary_restore_commands() → same for fallback mvn dependency:tree

This is identical to how the scan command passes the option through — same dict key, same consumer.

Test plan

  • Run cycode report sbom --format spdx-2.3 path --maven-settings-file /path/to/settings.xml /path/to/maven-project and verify the custom settings file is used during Maven dependency restore
  • Run cycode report sbom --format spdx-2.3 path /path/to/maven-project without the flag and verify default behavior is unchanged
  • Run cycode report sbom path --help and verify --maven-settings-file appears under "SCA options"

Co-authored-by: Cursor <cursoragent@cursor.com>
@ronens88 ronens88 force-pushed the CM-59712/add-maven-settings-to-report-sbom branch from f31f24f to 08ca4d0 Compare February 16, 2026 15:59
@gotbadger gotbadger merged commit b3ae1da into cycodehq:main Feb 18, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments