how to analysis local project through remote server in sonar lint - java

I have project in my local machine but sonar server is on remote location. Is there any way to analysis my local project with remote sonar server.
I am using sonarLint plugin in my eclipse luna.

The most recent versions of SonarLint do not rely on a SonarQube server. It works completely offline as it include all necessary analyzers and settings.
Soon, it will be possible to connect it to a SonarQube server to use information from it, for example, quality profiles and resolved issues.

Related

Sonarlint not showing SonarQube java squid issues (records)

Regarding issues reported by SonarLint On-The-Fly for one java file, I see a small subset of issues for the java file. As compared to the SQUID issues shown on SonarQube server for the same file.
I am using SonarQube server version 6.3, SonarLint 3.1.0.and Eclipse Neon.3. Sonarlint is connected to the server successfully and the eclipse project is linked to the project on SonarQube server. The project has component projects and this particular file is in an eclipse component project.
This squid:S1258 does not show in Sonarlint although present in the file; however this squid:S2293 shows on both Sonarlint and SonarQube.
Please advise
The Sonarlint plugin apparently does not utilize the project references to other projects in eclipse. Our applications are represented in multiple eclipse projects. The solution that seems to work is simply to associate each eclipse project to the same SonarQube server project.
I had the same problem, in my case these are the versions in use:
Eclipse Mars.2 (4.5.2)
SonarLint for Eclipse 3.2.0.xxxx
SonarQube Server 6.1
Linux RedHat 64 bit OS
Make sure your Eclipse project is bound to the remote SonaQube server project: sometimes the binding is lost or simply the auto bind feature fails with no warning.
Right click your Eclipse project -> SonarLint -> Bind to a SonarQube project
On the window that pops up verify the SonarQube server is selected, click on
Auto bind selected projects
check that remote bound project is correct and then click Finish.
You can repeat the procedure to verify the binding is still there.
You can apply the procedure to multiple projects at once, just select them before right-clicking.

Sonar maven plugin failing after upgrade to version 4.3.2

I upgraded my sonar version from 3.7 to 4.3.2. I understand from the release notes that alerts have been replaced with quality gates concept and when I log in to the dashboard, I do not see any quality profile that I had created before. I created a quality gate and set that as the default one.
On executing sonar from maven using sonar maven plugin, I get the following error - You must install a plugin that supports the language 'java'. I use the jacoco plugin to get multi module code coverage.
Is there any change that I need to do in my POM to get it running again?
This error occurs when installed plugins (directory extensions/plugins) are not copied before upgrading. Error logs will be improved in next versions.

Sonar version 3.6 required for local analysis

Coming across "Sonar version 3.6 is required to perform local analysis" message
when try to use Sonar Local Analysis in eclipse.
I just installed latest from CodeHaus
where the Compatibility Matrix is saying it 3.6+.
I am using Eclipse: Juno 4.2, with following plugins installed:
Sonar Java Analyser 3.2.0.20130627-1142-RELEASE org.sonar.ide.eclipse.jdt.feature.feature.group SonarSource
Sonar m2e Connector 3.2.0.20130627-1142-RELEASE org.sonar.ide.eclipse.m2e.feature.feature.group SonarSource
Any ideas?
Are you running a sonarqube server?
I don't think you can use the plugin without the server running to connect to to do the analysis.
http://docs.sonarqube.org/display/SONAR/SonarQube+in+Eclipse
For the purposes you are looking at, I am assuming personal use, you could probably get away with the standalone instance of SonarQube, using the H2 embedded database.
Local Analysis Parameters
Parameters to configure local analysis can be set in various places. Here is the hierarchy of parameters:
Parameters defined in the SonarQube Web UI
Parameters set in the pom.xml file (for Maven projects only, with the
m2e connector installed) will override parameters defined in the UI
Parameters defined in Eclipse will override parameters defined in
the pom file (go to Window > Preferences > Sonar > Local analysis
properties)
Parameters defined at project level in Eclipse will override
parameters defined at Eclipse level (right click on the project and
go to Properties > Sonar > Local analysis properties)
Excluding Plugins
Some plugins (useless for a local analysis) can be skipped while performing a local analysis thanks to the sonar.dryRun.excludePlugins property (Settings > Configuration > General Settings > General).
The default value is 'devcockpit,pdfreport,report,scmactivity,views'. For example, to skip the Build Stability plugin (due to https://jira.codehaus.org/browse/SONARIDE-346), set the property to 'devcockpit,pdfreport,report,scmactivity,views,buildstability'.
Here is where I found this information: Running Sonar Qube In Eclipse
Double Check your settings
You might also want to double check your settings. The plugin will install the sonar instance for you for local analysis on localhost:9000. If you deleted this, this might be giving you the errors. You should have 2 servers listed on the config page, localhost, and your remote server
Refer back to this page too: Configuring Sonar With Eclipse
With Sonar plug-in 3.0 local analysis could be launched fine.
With Sonar plug-in 3.2 I get the same error as you.
Please choose "Install new software..." and enter URL :
http://dist.sonar-ide.codehaus.org/eclipse-archives/3.0.0/
I had the same problem because I updated the eclipse plugin but forgot to update the sonar-server (SonarQube).
After following the upgrade guide and installing SonarQube 3.6.2 it worked again.

Unknown error - sonar eclipse plugin

I have installed the sonar eclipse plugin in eclipse Juno. I put the groupid and the artifactid into the proper lines, however I get an error:
Unknown exception
How to configure the sonar plugin properly in eclipse?
You need to install Sonar on a server (or run it on your machine for testing). Then you need to configure it in the Eclipse properties and choose it from the drop-down in the associate with sonar dialog (unless it runs on your machine, in which case it is already available from the drop down).
Before you can associate a project with sonar, you need to run the sonar analysis on that project (usually using maven). Take a look at the sonar documentation to get more information.

Using the sonar plugin with eclipse

I'm trying to use Sonar to analyse my projects in Eclipse. I am currently using Maven in eclipse. I installed the Sonar Eclipse plugin as described in this link.
But when I try and associate my project with Sonar, I get an error saying:
project with key not found on server.
Am I missing some steps? I started the Sonar Server before connecting to eclipse. But nothing works.
I even tried following this article (Sonar plugin Eclipse) but to no avail.
Please help..The Sonar documentation is not descriptive at all making it very hard for beginners like me to understand.
You can not associate your project in Eclipse if you haven't first analysed it with Sonar (by running "mvn sonar:sonar" on your project).
Once your project has been succesfully analysed and that you can browse it in the Web UI (http://localhost:9000 by default), then you can try to associate your project within Eclipse and this will work.

Categories

Resources