Licence for Sonarqube C/C++ Community Plugin

4,615 views
Skip to first unread message

gargg...@gmail.com

unread,
Feb 21, 2016, 5:59:35 PM2/21/16
to SonarQube
Dear All,

I am new to using Sonarqube C/C++ Community plug in. I am struggling to find out whether I need a licence or not

After I start the server, build the code with build-wrapper, run cppcheck on the code and setup properties file with cppCheck xml report and run the Sonar scanner, the scanner runs fine but at the end gives an error saying

no licence for cpp

I am not sure what the problem is. I wrote the language as C in the properties file, but there are no cpp files in the project

Can anybody help please?

Thanks & Regards,
Gaurav

Scott B.

unread,
Feb 21, 2016, 6:23:35 PM2/21/16
to SonarQube, gargg...@gmail.com
Hi.

You are mixing two different plugins.

SonarSource C/C++ plugin: requires a commercial license. Website: http://www.sonarsource.com/products/plugins/languages/cpp/
SonarQube C++ Community plugin: open source alternative, doesn't require a license. Website: https://github.com/SonarOpenCommunity/sonar-cxx

The "build-wrapper" is part of the SonarSource C/C++ plugin, thus requiring a license. The message "no licence for cpp" means that you don't have a license for the "cpp" plugin (the commercial one).

So, contact the SonarSource support to get a license.

gargg...@gmail.com

unread,
Feb 22, 2016, 9:28:29 AM2/22/16
to SonarQube, gargg...@gmail.com
Dear Scott,

Many thanks Scott for your !

I made corrections and  now i am trying to use the C/C++ community plug-in and have now installed the correct "free" plug in:


I have removed the build-wrapper from my sonar properties file too and just using the cppcheck to get the report for which I give the path in the properties file
I have un-installed the commercial plug-in

But now when I run the sonar server and then run the scanner, I get this:

sonar-runner.bat
C:\sonar-runner\sonar-scanner-2.5\bin\..
INFO: Scanner configuration file: C:\sonar-runner\sonar-scanner-2.5\bin\..\conf\sonar-runner.properties
INFO: Project configuration file: C:\cc_views\GGarg_CueHo_view2\cm_fw_app\dte\code\sonar-project.properties
INFO: SonarQube Scanner 2.5
INFO: Java 1.8.0_65 Oracle Corporation (64-bit)
INFO: Windows 7 6.1 amd64
INFO: User cache: C:\Users\ggarg\.sonar\cache
INFO: Load global repositories
INFO: Load global repositories (done) | time=203ms
INFO: User cache: C:\Users\ggarg\.sonar\cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=0ms
INFO: Default locale: "en_GB", source code encoding: "UTF-8"
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=109ms
INFO: Apply project exclusions
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=124ms
INFO: Load active rules
INFO: Load active rules (done) | time=1235ms
INFO: SCM provider autodetection failed. No SCM provider claims to support this project. Please use sonar.scm.provider to define SCM of your project.
INFO: Publish mode
INFO: -------------  Scan C :: Test :: DTE
INFO: Load server rules
INFO: Load server rules (done) | time=639ms
INFO: 31 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: Quality profile for c++: Sonar way
Exception in thread "main" java.lang.NoSuchMethodError: org.sonar.api.resources.Project.getFileSystem()Lorg/sonar/api/resources/ProjectFileSystem;
        at org.sonar.plugins.cxx.squid.CxxSquidSensor.shouldExecuteOnProject(CxxSquidSensor.java:81)
        at org.sonar.batch.bootstrap.BatchExtensionDictionnary.shouldKeep(BatchExtensionDictionnary.java:260)
        at org.sonar.batch.bootstrap.BatchExtensionDictionnary.getFilteredExtensions(BatchExtensionDictionnary.java:101)
        at org.sonar.batch.bootstrap.BatchExtensionDictionnary.select(BatchExtensionDictionnary.java:74)
        at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:46)
        at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:98)
        at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
        at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243)
        at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238)
        at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
        at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
        at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
        at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
        at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
        at org.sonar.runner.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:274)
        at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:165)
        at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:152)
        at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:118)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:80)
        at org.sonarsource.scanner.cli.Main.main(Main.java:66)

I am not sure which method is wrong. Also, do I need to wrap the build using some opensource tool now instead of build-wrapper please?
I was using build-wrapper earlier with the scons command which I use to build my code (we have only c code, hoping that this commercial plug-in will still work with C code)

Many thanks for your help again!
Kind Regards,
Gaurav

G. Ann Campbell

unread,
Feb 22, 2016, 9:43:02 AM2/22/16
to SonarQube, gargg...@gmail.com
Hi, 

Questions about https://github.com/SonarOpenCommunity/sonar-cxx should be directed there.


Thx,
Ann
Reply all
Reply to author
Forward
0 new messages