Skip to content

Commit

Permalink
Skip comments in pom.xml dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
simisimon committed Dec 6, 2024
1 parent af9e9ee commit d2585c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cfgnet/plugins/concept/maven_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def is_responsible(self, abs_file_path: str) -> bool:
def parse_tree(self, subtree_root: _Element, parent_node: Node):
name = subtree_root.tag

# remove prefix in curly brackets
name = self._remove_prefix(name=name)

if name:
Expand Down Expand Up @@ -153,7 +152,13 @@ def _get_fully_qualified_name(self, subtree: _Element) -> str:
artifactID = None
groupID = None
version = None
print("Subtree: ", subtree.tag, subtree.text)
for child in subtree:
if child.tag is ET.Comment:
continue

print("Tag: ", child.tag, type(child.tag), child.text)

tag = self._remove_prefix(name=child.tag)
if tag == "artifactId":
artifactID = child.text
Expand Down
1 change: 1 addition & 0 deletions tests/files/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<!--<scope>runtime</scope>-->
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
Expand Down

0 comments on commit d2585c5

Please sign in to comment.