diff --git a/pkg/crawler/crawler.go b/pkg/crawler/crawler.go index 3a0afca..b88c0b4 100644 --- a/pkg/crawler/crawler.go +++ b/pkg/crawler/crawler.go @@ -23,7 +23,7 @@ import ( "github.com/aquasecurity/trivy-java-db/pkg/types" ) -const mavenRepoURL = "https://repo.maven.apache.org/maven2/" +const mavenRepoURL = "https://repo.maven.apache.org/maven2/academy/compose/companion/multi-fab/" type Crawler struct { dir string @@ -230,10 +230,12 @@ func (c *Crawler) crawlSHA1(ctx context.Context, baseURL string, meta *Metadata, return !bytes.Equal(v.SHA1, dirVersionSha1) }) - versions = append(versions, Version{ - Version: dirVersion, - SHA1: dirVersionSha1, - }) + if dirVersionSha1 != nil { + versions = append(versions, Version{ + Version: dirVersion, + SHA1: dirVersionSha1, + }) + } foundVersions = append(foundVersions, versions...) } diff --git a/pkg/crawler/testdata/abbot_abbot.html b/pkg/crawler/testdata/abbot_abbot.html index c12f4bf..ecba60b 100644 --- a/pkg/crawler/testdata/abbot_abbot.html +++ b/pkg/crawler/testdata/abbot_abbot.html @@ -21,6 +21,7 @@

abbot/abbot

0.12..../ 2005-09-20 05:44 - 0.13.0/ 2005-09-20 05:44 - 1.4.0/ 2015-09-22 16:03 - +1.5.0/ 2015-09-22 16:03 - maven-metadata.xml 2015-09-24 14:18 402 maven-metadata.xml.md5 2015-09-24 14:18 32 maven-metadata.xml.sha1 2015-09-24 14:18 40