From 1fac7bf1ba8d18dd14da67e2e3aa831e2dea4306 Mon Sep 17 00:00:00 2001 From: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com> Date: Mon, 13 Mar 2023 04:11:25 +0600 Subject: [PATCH] fix: disable jar analyzer for scanners other than vuln (#3810) --- pkg/commands/artifact/run.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/commands/artifact/run.go b/pkg/commands/artifact/run.go index 33b3346695..58904294af 100644 --- a/pkg/commands/artifact/run.go +++ b/pkg/commands/artifact/run.go @@ -498,8 +498,7 @@ func disabledAnalyzers(opts flag.Options) []analyzer.Type { // But we don't create client if vulnerability analysis is disabled and SBOM format is not used // We need to disable jar analyzer to avoid errors // TODO disable all languages that don't contain license information for this case - if opts.Scanners.Enabled(types.LicenseScanner) && !opts.Scanners.Enabled(types.VulnerabilityScanner) && - !slices.Contains(report.SupportedSBOMFormats, opts.Format) { + if !opts.Scanners.Enabled(types.VulnerabilityScanner) && !slices.Contains(report.SupportedSBOMFormats, opts.Format) { analyzers = append(analyzers, analyzer.TypeJar) }