mirror of
https://github.com/anchore/syft.git
synced 2026-10-31 22:46:36 +01:00
fix(java): skip comment lines in gradle.lockfile (#5372)
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com> Co-authored-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
This commit is contained in:
co-authored by
Pujitha Paladugu
parent
4c500520d0
commit
722df28ed1
@@ -35,6 +35,11 @@ func parseGradleLockfile(_ context.Context, _ file.Resolver, _ *generic.Environm
|
||||
// Trim leading and trailing whitespace from the line
|
||||
line = strings.TrimSpace(line)
|
||||
|
||||
// skip comment lines (e.g. the header gradle writes), which may contain ':' and '=' characters
|
||||
if strings.HasPrefix(line, "#") {
|
||||
continue
|
||||
}
|
||||
|
||||
groupNameVersion := line
|
||||
groupNameVersion = strings.Split(groupNameVersion, "=")[0]
|
||||
parts := strings.Split(groupNameVersion, ":")
|
||||
|
||||
Reference in New Issue
Block a user