I am trying to execute following maven command from jenkins job,
mvn clean install sonar:sonar -Dsonar.host.url=http://hostname:9095/sonar -Dsonar.projectKey=mavensam
We had a same issue. In our case both Jenkins and SonarQube were running on the same machine behind a reverse proxy. It resolved our issue after updating sonar host URL to http://localhost:9000.