xsilmarx
xsilmarx

Reputation: 749

Is it possible in sonar (using sonar-runner) to inherit properties from other existing sonar-project.properties file?

I have several small projects (more than 100), which are Eclipse-based plugins/bundles, to be configured to run the Sonar analysis, that will share most of the configurations, such as the database and url of Sonar server. This setup is not using maven.

My idea would be to have a master sonar-project.properties, and then in each project (eclipse plugin/bundle) I would put only what is specific to that project, such as the project ID to be used when publishing to Sonar server.

Is it possible to achieve this with some kind of configuration in Sonar? Otherwise I would need to create some script to perform this, like copying the master file to each project folder and replacing the project ID by the specific one.

(Note: the goal is not to run the Sonar within Eclipse, but outside using a continuous integration system, like Jenkings, to run the analysis using sonar-runner)

Upvotes: 1

Views: 569

Answers (2)

John Wright
John Wright

Reputation: 4607

If the settings will be the same for every project, you could add them to the sonar-runner.properties file. I have done this for system-specific items (like path to SDKs, executables, etc).

Note, however, that this would apply to every project that runs with sonar-runner and isn't really an inheritance model.

Upvotes: 0

If you want to make the analysis of your code with Jenkins, then you should use the SonarQube Jenkins plugin that allows you to centralize configuration of SonarQube servers so that you don't have to repeat it on each new job. Read the documentation carefully and this should answer most of your needs.

Upvotes: 0

Related Questions