Reputation: 846
I have started playing around with the SonarQube Java API. As of now i am able to create project, profile, or add/modify user using the API. Is it possible to analyze a project using the API ?
Generally i use the SonarQube Scanner plugin to analyze my source code, where i need to provide two properties file sonar-runner.properties and sonar-project.properties. The 2nd one includes all the project specific info but the 1st one requires all the details about the database including username, password, and connection string. Now from the admin prospective it's very hard to share all those info.
So i am trying to figure out something to the analyze source code on the fly using some API/Web service.
Any kind of idea would be highly appreciable.
Upvotes: 3
Views: 2022
Reputation: 7321
Use a recent SonarQube version. :) Since SonarQube 5.2, scanners no longer access the database (see blog post).
On the topic of analysing a project through Web Service, that's an anti-pattern. It's not the server's job to inspect source code, it's the scanner's job. Scanners get executed where the code is, and report back to the server. There's no such thing as the server invoking a scanner.
Upvotes: 7