so that noone needs to manually configure 30+ Projects to bind to the right sonar-project-names etc.
Please do not suggest something like autobinding, that is still a manual process which needs not only be done for every project once but also you need to find the right project name if you have multiple project_key-candidates to select from
//edit: I also would like to add the sonarqube-server configuration by editing the Eclipse-Installation and not as a manual process … if that is possible it would be very nice to be able to do that
If that is not possible currently … i would very humbly like to ask for guidance concerning any other possibly existing way how to ease this setup procedure for the developer.
You should be looking at Eclipse Oomph which can help you automate the installation and setup of your workspace. You can add the SonarLint plug-in as a requirement, list all your projects in a project set to be automatically checked out from source control, and adapt the configuration files as required, etc.
We have added org.sonarlint.eclipse.core.prefs to source control with the reference to the project and module on Sonar. The Sonar server is also pre-defined.
The only manual process left is for our end users to generate their token on the Sonar server and enter it once in Eclipse.
I am sorry to be so late to answer your answer, but it definitely looks like something i might be able to accomplish.
I will gladly mark your reply as an answer … but, if i may humbly ask, would/could you be of help in creating the content which i will need to feed to oomph?
I am still getting my feet wet (and am currently lacking the time to further experiment) with oomph … so i would be glad to be able to ask you here in this thread as a Reply. This would probably also make this thread more whole.
(just to point it out: i ment, i would like to - in the future - use this thread to ask you about uncertainties i probably will be having when further experimenting with oomph and sonarlint)
As discussed in this thread this manual process is even too much for some members of our team. It would be great if something could be improved.
As for the suggestion with Oomph, I do not see any possibility to automate the connection to the SonarQube Server right now.
The server management is in a separated view (and not in the general workspace preferences), I can not use the Oomph pref recorder to record and replay this configuration across the team workspace.
It would be great to have a specific Oomph setup task to configure the SonarQube server (in a similar way that you can define that you would like to query your issue-tracker as part of the Oomph setup script).
As alternative, could you provide an hint where the server-setup is stored? Is that a file in the .metadata folder of the workspace?
=> I am ready to investigate even nonofficial API to perform the setup.
The server connection metadata are stored in the Eclipse instance scope. It means that if you have multiple workspaces, you don’t have to configure the server again and again.
I’m sorry I don’t know OOMPH in details, but I remember it was possible to record server preferences with the old workspace mechanics plugin.
Also, if you are packaging a custom Eclipse bundle in your company, you can provide a plugin_customization.ini to automatically provision the server.
The only thing missing is the ability to provide a token. Since it is stored in the secure storage, I’m not sure it is possible to automate that. So users will need to edit the server connection to set a token.
For me, the files storing the configs are stored inside the workspace folder, under <workspace>/.metadata/.plugins/org.eclipse.core.runtime/.settings/:
File 1: org.sonarlint.eclipse.core.prefs
File 2: org.sonarlint.eclipse.ui.prefs
File 1 contains the list of SonarQube servers, the keys contains the server id, as used later in the .settings/org.sonarlint.eclipse.core.prefs file of the projects (the serverId entry). The keys looks like this:
servers/<severId-value>/auth
servers/<severId-value>/notificationsEnabled
servers/<severId-value>/url
File 2 contains user-interface settings, for example if you disable the display of the SonarLint console when there is an error. Something you would have to do like this:
Of course you can probably do the same with plugin_customization.ini or with Oomph as explained by Philippe_Cade in the previous message.
I am still investigating how I can set the token for this server (putting something into the secure store). I think this can also be achieved programmatically.