Wednesday, May 11, 2016

Sonar Configuration: Common Issues

Following are some common issues that someone might face while working with Sonar for the first time:

1) Caused by: Status returned by url : 'http://localhost:9000/api/server/version' is invalid : 404

Solution: This error might come because of incorrect URL configuration in sonar-runner.properties. If sonar.web.context property in sonar.properties is not default then sonar.host.url property in the sonar-runner.properties must include that context. So if sonar.web.context=/sonar then sonar.host.url should be http://localhost:9000/sonar

2) Caused by: You must define the following mandatory properties for '<sonar.projectKey value>': sonar.sources

Solution: This error indicates that sonar.sources is missing in the sonar-project.properties. This property should point to source files on which report is to be generated like Java files.