CM-59712: add --maven-settings-file to report sbom path command#385
Merged
gotbadger merged 2 commits intocycodehq:mainfrom Feb 18, 2026
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
f31f24f to
08ca4d0
Compare
3 tasks
gotbadger
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--maven-settings-fileoption toreport sbom pathcommand so Maven projects can use a customsettings.xmlwhen generating SBOM reports locallyWhy this works
The
report sbom pathcommand already runs the same local dependency restore pipeline asscan -t sca pathviaadd_sca_dependencies_tree_documents_if_needed(). The Maven restore handler (RestoreMavenDependencies) readsctx.obj.get('maven_settings_file')to append-s <path>to themvncommand — this change simply populates that key from a new CLI option.Call chain:
appcallback →ctx.ensure_object(dict)initializesctx.objreport_commandcallback → setsprogress_barsbom_commandcallback → setsreport_parameters,output_filepath_command→ setsctx.obj['maven_settings_file'](this PR)add_sca_dependencies_tree_documents_if_needed()→ checksno_restore(defaultsFalse), calls_add_dependencies_tree_documents()RestoreMavenDependencies.get_commands()→ readsself.ctx.obj.get('maven_settings_file'), appends-s <path>tomvn cyclonedx:makeAggregateBomRestoreMavenDependencies.create_secondary_restore_commands()→ same for fallbackmvn dependency:treeThis is identical to how the
scancommand passes the option through — same dict key, same consumer.Test plan
cycode report sbom --format spdx-2.3 path --maven-settings-file /path/to/settings.xml /path/to/maven-projectand verify the custom settings file is used during Maven dependency restorecycode report sbom --format spdx-2.3 path /path/to/maven-projectwithout the flag and verify default behavior is unchangedcycode report sbom path --helpand verify--maven-settings-fileappears under "SCA options"