moved optional arguments, to prevent failure when not providing them
ci/woodpecker/push/build Pipeline failed Details
ci/woodpecker/pr/build Pipeline was successful Details

pull/1/head
gapodo 2022-10-31 19:48:20 +01:00
parent 78246342b2
commit 79705bb2db
1 changed files with 2 additions and 3 deletions

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",