From 204d9eebeb3aa44afac723b86a588d6c180a7dba Mon Sep 17 00:00:00 2001 From: mcoops Date: Fri, 19 Nov 2021 18:16:49 +1100 Subject: [PATCH] java: ignore files with 'sources' or 'javadoc' in the name (#58) --- deplist.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deplist.go b/deplist.go index 928891e..bac93a6 100644 --- a/deplist.go +++ b/deplist.go @@ -129,6 +129,10 @@ func GetDeps(fullPath string) ([]Dependency, Bitmask, error) { // java if ext == ".jar" || ext == ".war" || ext == ".ear" || ext == ".adm" || ext == ".hpi" || ext == ".zip" { + file := strings.Replace(filepath.Base(path), ext, "", 1) // get filename, check if we can ignore + if strings.HasSuffix(file, "-sources") || strings.HasSuffix(file, "-javadoc") { + return nil + } pkgs, err := scan.GetJarDeps(path) if err == nil {