File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -434,12 +434,24 @@ func (p Plugin) Exec() error {
434434
435435 if os .IsNotExist (err ) || ! p .Config .UseSonarConfigFile {
436436 // If the configuration file does not exist, use the default parameters
437- fmt .Println ("Configuration file not found. Using default parameters." )
437+ fmt .Println ("Configuration file not found or sonar_config_file not set to true . Using plugin's parameters." )
438438 args = []string {
439439 "-Dsonar.host.url=" + p .Config .Host ,
440440 "-Dsonar.login=" + p .Config .Token ,
441441 }
442442
443+ if len (p .Config .Host ) < 1 || len (p .Config .Token ) < 1 {
444+ fmt .Println ("sonar_token and sonar_host params are mandatory." )
445+ fmt .Println ("Exiting with status 2" )
446+ os .Exit (2 )
447+ }
448+
449+ if len (p .Config .Key ) < 1 {
450+ fmt .Println ("sonar_key (prject key) param is mandatory." )
451+ fmt .Println ("Exiting with status 2" )
452+ os .Exit (2 )
453+ }
454+
443455 // Map of potential configurations
444456 configurations := map [string ]string {
445457 "-Dsonar.projectKey" : p .Config .Key ,
You can’t perform that action at this time.
0 commit comments