Setup sonarlint with Oomph.

405 views
Skip to first unread message

mattias

unread,
Mar 6, 2017, 8:27:56 AM3/6/17
to SonarLint

Hi I would like to setup the SonarQube server with Ommph. We use no authentication. With Ommph I can create the following properties:


;cat .metadata/.plugins/org.eclipse.core.runtime/.settings/org.sonarlint.eclipse.core.prefs

eclipse.preferences.version=1

servers/MySonar/auth=false

servers/MySonar/url=http\://my.sonar.org\:9004

servers/initialized=true

;


However no servers are found in the ”Sonar Qube Servers”-view until I restart Eclipse, when Eclipse starts I get the popup ”SonarLint stored configuration outdated” and then the server is listed in the view.  


Is it possible to get this working without the restart?

Julien HENRY

unread,
Mar 6, 2017, 8:47:46 AM3/6/17
to mattias, SonarLint
Hi Mattias,

I think your problem is similar to:

We'll try to address this issue in an upcoming release.

++

Julien

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/355eded3-5b4d-431e-83fd-500894fa17b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mattias.j...@gmail.com

unread,
Mar 22, 2017, 3:21:52 AM3/22/17
to SonarLint, mattias.j...@gmail.com
Hi Julien,

That would be great.


I would also like to be able to configure a default SonarQube project to help the “Auto bind” feature. In Oomph it would be easy to figure out this value as I know the branch name.


We currently have 170 project in the Workspace and over 10 branches (SonarQube Projects). It becomes painful to manually configure each project.


It would be even better to be able to configure eclipse to start-up with all projects in connected mode as un-connected mode does not make any sense for us.


Br Mattias


On Monday, March 6, 2017 at 2:47:46 PM UTC+1, Julien HENRY wrote:
Hi Mattias,

I think your problem is similar to:

We'll try to address this issue in an upcoming release.

++

Julien
2017-03-06 14:27 GMT+01:00 mattias <mattias.j...@gmail.com>:

Hi I would like to setup the SonarQube server with Ommph. We use no authentication. With Ommph I can create the following properties:


;cat .metadata/.plugins/org.eclipse.core.runtime/.settings/org.sonarlint.eclipse.core.prefs

eclipse.preferences.version=1

servers/MySonar/auth=false

servers/MySonar/url=http\://my.sonar.org\:9004

servers/initialized=true

;


However no servers are found in the ”Sonar Qube Servers”-view until I restart Eclipse, when Eclipse starts I get the popup ”SonarLint stored configuration outdated” and then the server is listed in the view.  


Is it possible to get this working without the restart?

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
Message has been deleted

Julien HENRY

unread,
Jul 10, 2017, 4:04:02 AM7/10/17
to ajtak....@gmail.com, SonarLint
Hi Katja,

Eclipse preference API will generate events when properties are updated, and we are already listening to them. I don't think that creating a preference file "manually" while Eclipse is running is a supported use case.

I don't know OOMPH, but don't it provide a way to interact with preferences in a more "programmatic" way? I know for example that Workspace Mechanics plugin used to create/update properties using the Eclipse API (not touching files on the filesystem).

++

Julien Henry | SonarSource

Developer

http://sonarsource.com


2017-07-10 9:50 GMT+02:00 <ajtak....@gmail.com>:
Hey,

at our company we have the same problems as described by Mattias.

Some background:
We have an Oomph setup for the Eclipse installation and workspace/projects configuration.
We want to use the SonarLint plugin instead of a dedicated checkstyle plugin.
We have an Oomph task that creates the '{workspace}\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.sonarlint.eclipse.core.prefs' with the right content.

(1) we think that the described bug is not fixed (we are using the SonarLint 3.2)
Testcase: while Eclipse is running, we manually copy a 'org.sonarlint.eclipse.core.prefs' file with the below content to '{workspace}\.metadata\.plugins\org.eclipse.core.runtime\.settings\'.
At that point in time, nothing happens. Only after an Eclipse restart, a popup window (see below) appears.

eclipse.preferences.version=1
servers/pcrcsonarqubete/auth=false
servers/pcrcsonarqubete/url=http\://mysonar\:8080/sonar



Could you provide an explanation or reopen the bug as not fixed?

Problems shown when using Oomph:
If we trigger the oomph task (creation of '{workspace}\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.sonarlint.eclipse.core.prefs') at the installation time, the popup window apears right after the Eclipse is started for the first time.
That is actually too soon, because our workspace projects are not yet imported (that takes a lot of time due to the size of the workspace) and if someone clicks at the 'Update' right away, sonarLint server information is not updated correctly.
Workaround: Click the popup-window after all the project are imported. Or if you click it too soon, you need to open the SonarQube-Servers-View manually after the workspace projecta are imported, right click on the Server, and choose Update-Server from the context menu.

On the other hand, if we trigger the oomph task at the 'workspace-startup' time (which would be more suitable), the popup doesn't show up at the first Eclipse start, but only at the first restart.


(2) we find the manual connection of all the workspace projects (100+) to a correct SonarQube Project (choosing the correct branch out of several ones) just tedious

Problems shown when using Oomph:
We want that explicitly/merely Oomph takes care of the SonarLint plugin configuration, but this seems impossible at the moment.
Even if you provide the server settings in form of a '{workspace}\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.sonarlint.eclipse.core.prefs', and the server information is updated correctly, the workspace projects will be disconnected by default.
When the projects are disconnected, the sonarLint will be in a "standalone" mode and it will use the default set of rules - which can be very misleading if you wish to use SonarLint on-the-fly analysis.
Only after all the projects are manually marked and the correct sonarQube project is chosen, the SonarLint will actually start working correctly - applying the correct set of rules for the on-the-fly analysis.
This procedure doesn't meet our understanding of 'automatic IDE setup', as the user would need to mark 100+ projects manually and choose the right SonarQube project.
Our workaround here is that we provide a 'org.sonarlint.eclipse.core.prefs' for every workspace project (checked in to source control, not provided by Oomph) with a hard-coded SonarQube project (hard coded branch).

Is there any work planned in this area?

Thank you.
Katja

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/42bb41d8-d343-43f3-9ad5-5184de4b09aa%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages