removed scanner, moved optional arguments to prevent error when unset #1

Merged
gapodo merged 1 commit from test-when into main 2025-01-24 00:20:30 +01:00

View file

@ -127,8 +127,6 @@ func (p *Plugin) generateScannerArgs() []string {
if !p.Config.UsingProperties { if !p.Config.UsingProperties {
argsParameter := []string{ argsParameter := []string{
"-Dsonar.projectKey=" + p.Config.Key, "-Dsonar.projectKey=" + p.Config.Key,
"-Dsonar.projectName=" + p.Config.Name,
"-Dsonar.projectVersion=" + p.Config.Version,
"-Dsonar.sources=" + p.Config.Sources, "-Dsonar.sources=" + p.Config.Sources,
"-Dsonar.ws.timeout=" + strconv.Itoa(p.Config.HttpTimeout), "-Dsonar.ws.timeout=" + strconv.Itoa(p.Config.HttpTimeout),
"-Dsonar.log.level=" + p.Config.SonarLogLevel, "-Dsonar.log.level=" + p.Config.SonarLogLevel,
@ -137,10 +135,11 @@ func (p *Plugin) generateScannerArgs() []string {
} }
args.append(argsParameter...) args.append(argsParameter...)
args.appendIfNotEmpty("-Dsonar.projectName=", p.Config.Name)
args.appendIfNotEmpty("-Dsonar.projectVersion=", p.Config.Version)
args.appendIfNotEmpty("-Dsonar.java.binaries=", p.Config.Binaries) args.appendIfNotEmpty("-Dsonar.java.binaries=", p.Config.Binaries)
args.appendIfNotEmpty("-Dsonar.exclusions=", p.Config.Exclusions) args.appendIfNotEmpty("-Dsonar.exclusions=", p.Config.Exclusions)
args.appendIfNotEmpty("-Dsonar.inclusions=", p.Config.Inclusions) args.appendIfNotEmpty("-Dsonar.inclusions=", p.Config.Inclusions)
} }
p.Logger.Debugw("argsbuilder", p.Logger.Debugw("argsbuilder",