I am having some issues running Sonar analysis in Eclipse. I have Java Maven project with Groovy Spock unit tests.
mvn sonar:sonar
Works fine and generates reports which I can see on the "localhost:9000". However I need to see issues in Eclipse. I have done the Configure->Associate... and now when I choose "SonarQube->Analyze" I get following errors in the console:
10:18:23.892 ERROR - Invalid value of sonar.libraries for com.otpp.email:bulkemail-downloader
Exception in thread "main" org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.impl.BatchLauncherMain.execute(BatchLauncherMain.java:41)
at org.sonar.runner.impl.BatchLauncherMain.main(BatchLauncherMain.java:59)
Caused by: java.lang.IllegalStateException: No files nor directories matching 'C:\Program Files\springsource\ggts-3.4.0.RELEASE\plugins\org.codehaus.groovy_2.0.7.xx-20130828-1400-e43-RELEASE\plugin_dsld_support\' in directory C:\Users\SHEVELD\workspace\bulkEmailDownloader
at org.sonar.batch.scan.DefaultProjectBootstrapper.validateDirectories(DefaultProjectBootstrapper.java:343)
and Eclipse also shows error pop-up with following details:
Error during execution of Sonar
Error status [command: C:\Program Files\Java\jdk1.7.0_45\jre\bin\java.exe -Dsonar.exclusions=file:**/fixtures/** -Dsonar.buildbreaker.skip=true -cp C:\Users\SHEVELD\AppData\Local\Temp\sonar-runner-impl8294792314646586115.jar org.sonar.runner.impl.BatchLauncherMain C:\Users\SHEVELD\AppData\Local\Temp\sonar-project5418432264915204295.properties]: 1
From all this codes I understand that there is some issue with sonar-eclipse-groovy triangle. Any hint is greatly appreciated!
Edit _________________ I reinstalled the GGTS into a non-shared folder (aka "C:\tools" and not "C:\Program Files"). Sonar plugin ran an analysis using my local server. However it stopped working upon switching to a remote server. Actually it worked with a local Sonar server for a bit. Now, when I switched to a remote Sonar server it again gives me the same error. Additionally I tried Installing Groovy plugin on the regular Kepler Eclipse and after doing that Sonar stopped working...
Removing Groovy DSL jar from the classpath solves the problem, but is pretty useless solution.
They created ticket for this issue:
https://jira.codehaus.org/browse/SONARIDE-430 after my question:
How can I file an issue for SonarQube Eclipse plugin
I would like to post this as a comment, but as mys reputation is lower 50 i can't do so...
1.) Checkthe following: In Eclipse go to "window --> preferences" and take a look if an entry for "SonarQube" exists or not.
1b.) If not go "Help --> Eclipse Marktplace" and search for SonarQube and install the plugin. Restart Eclipse now. Follow the instuctions in 1.)
2.) Click on SonarQube entry and then choose the Servers entry
3.) As default a Server is registered here already, but you can delete him. Click on "add" on the right side and fill in your data. Click "Test Connection" to make sure your settings are correct.
EDIT: Checked it on my own projects: I getting a "Unable to contact SonarQube server". Try to run the project as maven build within eclipse and use "sonar:sonar" as command. (Have you installed the Maven-Plugin in Eclipse?)