Problem with Connecting Jenkins to SonarQube
Create and add token to be able to connect to SonarQube.
You have create project in SonarQube and use it as a parameter:

sh """
   ${scannerHome}/bin/sonar-scanner \
   -Dsonar.projectKey=your_project_key_created_in_sonarqube_as_project \
   -Dsonar.sources=. \
"""




Copied from [StackOverflow] Problem with Connecting Jenkins to SonarQube.