Project configuration living with source code

I’m using sonarqube 6.7.4 on java project and I’m wonedring how or if it is possible to achive something like in checkstyle. For checkstyle I have config which is saved in GIT repository where are source codes. So if I return back project to previous version checkstyle will run on configuration which belongs to that version.

So for example:
I have version of project 1.0.0 which has some configuration 1.x.
Now I create version 2.0.0 in which I change the configuration slightly to 2.x so if I wuould like to run project 1.0.0 against this config it fails.

There is a request to fix something in version 1.0.0 so I need to get the configuration of 1.x and run sonar against this configuration. How can I do this?



From your mention of Checkstyle, I guess you’re asking about the ability to store in the project the list of rules that will be used in an analysis. The answer to that is no. The rule set, a.k.a. Quality Profile, is configured server-side and assigned to the project server-side.


Hi thanks for quick response. Is it possible to version quality profile and tell sonar with some property which version of quality profile should it use?


It’s possible to have multiple quality profiles - you can even create a new one via copying. But it’s not possible to analyze with anything but the current version of the profile.

You can assign a project to a profile using web services. You’ll find a link to the web service api documentation of your onboard services in your SonarQube footer.


@bilak in addition to what @ganncamp said, you might be also interested in this feature request Self-contained sonar configuration through property file

@saberduck that feature request is exactly what I need.