Skip to content

Commit 8dd0440

Browse files
amitmoskovitzclaude
andcommitted
CM-64214: Fall back to BOM when dependency:tree also produces no content
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 57addd9 commit 8dd0440

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

cycode/cli/files_collector/sca/maven/restore_maven_dependencies.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def try_restore_dependencies(self, document: Document) -> Optional[Document]:
6262
return None
6363

6464
if not _has_dependency_graph(restore_dependencies_document.content):
65-
return self.restore_from_secondary_command(document, manifest_file_path)
65+
fallback = self.restore_from_secondary_command(document, manifest_file_path)
66+
if fallback is not None and fallback.content is not None:
67+
return fallback
6668

6769
return restore_dependencies_document
6870

tests/cli/files_collector/sca/test_restore_maven_dependencies.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def test_falls_back_to_secondary_command_when_bom_has_no_dependency_graph(self)
5656
bom_doc = MagicMock(spec=Document)
5757
bom_doc.content = json.dumps({'dependencies': []})
5858
fallback_doc = MagicMock(spec=Document)
59+
fallback_doc.content = '[INFO] com.example:root:jar:1.0\n+- io.netty:netty-all:jar:4.1.0'
5960

6061
with (
6162
patch.object(instance, 'get_manifest_file_path', return_value='/project/pom.xml'),

0 commit comments

Comments
 (0)