SonarQube: errors in analysing C# and VB projects - sonarqube-msbuild-runner

I am trying to follow the instructions here to try SonarQube for MSBuild:
http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Scanner+for+MSBuild, but I got the following errors for C# and VB samples. I can't find any message in the sonar.log so don't know how to proceed.
C:\Tools\SonarQube\sonar-examples-master\projects\languages\csharp>where msbuild
C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe
C:\Tools\SonarQube\sonar-examples-master\projects\languages\csharp>MSBuild.SonarQube.Runner.exe end
SonarQube Scanner for MSBuild 1.1
Default properties file was found at C:\Tools\SonarQube\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml
Loading analysis properties from C:\Tools\SonarQube\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml
Post-processing started.
SonarQube Scanner for MSBuild End Step 1.1
WARNING: Duplicate project GUID: "12add147-fbaf-46aa-b8a4-f708d4d0f295". Check that the project is only being built for a single platform/co
nfiguration and that that the project guid is unique. The project will not be analyzed by SonarQube. Project file: C:\Tools\SonarQube\sonar-
examples-master\projects\languages\csharp\ConsoleApplication1\ConsoleApplication1.csproj
C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet>MSBuild.SonarQube.Runner.exe end
SonarQube Scanner for MSBuild 1.1
Default properties file was found at C:\Tools\SonarQube\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml
Loading analysis properties from C:\Tools\SonarQube\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml
Post-processing started.
SonarQube Scanner for MSBuild End Step 1.1
WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\huj\AppData\Local\Temp\.NETFr
amework,Version=v4.5.AssemblyAttributes.vb, project: C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\ConsoleApplication1\C
onsoleApplication1.vbproj
SONAR_RUNNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
Calling the SonarQube Scanner...
C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\.sonarqube\bin\sonar-runner\bin\..
SonarQube Runner 2.4
Java 1.8.0_60 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
SONAR_RUNNER_OPTS=-Xmx1024m
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\.sonarqube\bin\sonar-runner\bin\..\conf\s
onar-runner.properties
INFO: Project configuration file: C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\.sonarqube\out\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\.sonarqube\out\.sonar
INFO: SonarQube Server 5.2
15:43:49.634 INFO - Load global repositories
15:43:49.815 INFO - Load global repositories (done) | time=180ms
15:43:49.830 INFO - User cache: C:\Users\huj\.sonar\cache
15:43:50.224 INFO - Load plugins index
15:43:50.227 INFO - Load plugins index (done) | time=3ms
15:43:50.458 INFO - Process project properties
15:43:50.728 INFO - Load project repositories
15:43:50.741 INFO - Load project repositories (done) | time=13ms
15:43:50.747 INFO - Apply project exclusions
15:43:50.871 INFO - Load quality profiles
15:43:50.919 INFO - Load quality profiles (done) | time=48ms
15:43:50.924 INFO - Load active rules
15:43:51.344 INFO - Load active rules (done) | time=420ms
15:43:51.362 WARN - SCM provider autodetection failed. No SCM provider claims to support this project. Please use sonar.scm.provider to def
ine SCM of your project.
15:43:51.362 INFO - Publish mode
15:43:51.363 INFO - ------------- Scan ConsoleApplication1
15:43:51.459 INFO - Load server rules
15:43:51.629 INFO - Load server rules (done) | time=170ms
15:43:51.684 INFO - Base dir: C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\ConsoleApplication1
15:43:51.684 INFO - Working dir: C:\Tools\SonarQube\sonar-examples-master\projects\languages\vbnet\.sonarqube\out\.sonar\vbnet_vbnet_65E63A
B4-1055-4104-B233-A9F7CF2233DA
15:43:51.685 INFO - Source paths: Module1.vb, My Project/AssemblyInfo.vb, My Project/Resources.resx, My Project/Application.myapp, My Proje
ct/Settings.settings, App.config
15:43:51.685 INFO - Source encoding: UTF-8, default locale: en_US
15:43:51.686 INFO - Index files
15:43:51.709 INFO - 2 files indexed
15:43:51.711 INFO - Quality profile for vbnet: Sonar way
15:43:51.885 INFO - All FxCop rules are disabled, skipping its execution.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 3.142s
Final Memory: 11M/308M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
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)

Your C# project isn't being analysed because of the WARNING: Duplicate project GUID.... Check that your project guids are unique. You will also get this error if you run the begin step then call MSBuild multiple times for the same project before calling end. Try running begin, MSBuild .... end to see if that fixes the C# project issue. For the VB issue, please include more of the call stack from the Java error.

Related

SonarQube Code Coverage Not Parsing for VB.net Framework Running on Azure DevOps

We are having a problem with SonarQube reporting code coverage in a VB.net framework project. To troubleshoot, we created two simple projects. One in C# and the other in VB.net. The yaml files are identical except for the key and project name. We noticed that a portion in the C# log is not in the VB.net log. We've been working this for a few weeks, and I am at my wits end. Any help/recommendations would be appreciated.
yml:
trigger:
- master
pool:
name: Default
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
stages:
- stage: Build
jobs:
- job: Build
pool:
name: Default
steps:
- task: NuGetToolInstaller#1
- task: NuGetCommand#2
inputs:
restoreSolution: '$(solution)'
- task: SonarQubePrepare#5
displayName: 'Prepare analysis on SonarQube'
inputs:
SonarQube: SonarQube
projectKey: 'com.server.app.key:CSTest'
projectName: CSTest
- task: VSBuild#1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest#2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
codeCoverageEnabled: true
resultsFolder: '$(System.DefaultWorkingDirectory)\TestResults'
# Run Code Analysis task
- task: SonarQubeAnalyze#5
displayName: 'Run Code Analysis'
# Publish Quality Gate Result task
- task: SonarQubePublish#5
displayName: 'Publish Quality Gate Result'
inputs:
pollingTimeoutSec: '300'
C# log excerpt:
2022-07-29T16:29:55.7585662Z ##[section]Starting: Run Code Analysis
2022-07-29T16:29:55.7852727Z ==============================================================================
2022-07-29T16:29:55.7853073Z Task : Run Code Analysis
2022-07-29T16:29:55.7853367Z Description : Run scanner and upload the results to the SonarQube server.
2022-07-29T16:29:55.7853638Z Version : 5.6.1
2022-07-29T16:29:55.7853803Z Author : sonarsource
2022-07-29T16:29:55.7854358Z Help : Version: 5.6.1. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
...
2022-07-29T16:30:31.4351017Z INFO: ------------- Run sensors on project
2022-07-29T16:30:31.4560959Z INFO: Sensor C# [csharp]
2022-07-29T16:30:31.4806371Z INFO: Importing results from 5 proto files in 'C:\agent\_work\883\.sonarqube\out\0\output-cs'
2022-07-29T16:30:31.6816920Z INFO: Importing results from 5 proto files in 'C:\agent\_work\883\.sonarqube\out\1\output-cs'
2022-07-29T16:30:31.7124947Z INFO: Importing 2 Roslyn reports
2022-07-29T16:30:31.7710077Z INFO: Found 2 MSBuild C# projects: 1 MAIN project. 1 TEST project.
2022-07-29T16:30:31.7711973Z INFO: Sensor C# [csharp] (done) | time=313ms
2022-07-29T16:30:31.7712604Z INFO: Sensor C# Tests Coverage Report Import [csharp]
2022-07-29T16:30:31.7714255Z INFO: Parsing the Visual Studio coverage XML report C:\agent\_work\883\s\TestResults\sa_vstsagent_BUILD01_2022-07-29_11_29_51\In\BUILD01\sa_vstsagent_BUILD01_2022-07-29.11_29_43.coveragexml
2022-07-29T16:30:32.3466313Z INFO: Adding this code coverage report to the cache for later reuse: C:\agent\_work\883\s\TestResults\sa_vstsagent_BUILD01_2022-07-29_11_29_51\In\BUILD01\sa_vstsagent_BUILD01_2022-07-29.11_29_43.coveragexml
2022-07-29T16:30:32.3887422Z INFO: Coverage Report Statistics: 2 files, 1 main files, 1 main files with coverage, 1 test files, 0 project excluded files, 0 other language files.
2022-07-29T16:30:32.3978290Z INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=593ms
2022-07-29T16:30:32.3978788Z INFO: Sensor C# Unit Test Results Import [csharp]
2022-07-29T16:30:32.3979274Z INFO: Parsing the Visual Studio Test Results file 'C:\agent\_work\883\s\TestResults\sa_vstsagent_BUILD01_2022-07-29_11_29_51.trx'.**
2022-07-29T16:30:32.3979816Z INFO: Sensor C# Unit Test Results Import [csharp] (done) | time=32ms
2022-07-29T16:30:32.3980153Z INFO: Sensor Zero Coverage Sensor
2022-07-29T16:30:32.3980542Z INFO: Sensor Zero Coverage Sensor (done) | time=0ms
2022-07-29T16:30:32.3981345Z INFO: SCM Publisher SCM provider for this project is: git
2022-07-29T16:30:32.3981910Z INFO: SCM Publisher 4 source files to be analyzed
2022-07-29T16:30:32.6430256Z INFO: SCM Publisher 4/4 source files have been analyzed (done) | time=250ms
2022-07-29T16:30:32.6487517Z INFO: CPD Executor 1 file had no CPD blocks
2022-07-29T16:30:32.6488449Z INFO: CPD Executor Calculating CPD for 1 file
2022-07-29T16:30:32.6684874Z INFO: CPD Executor CPD calculation finished (done) | time=31ms
2022-07-29T16:30:32.7929589Z INFO: Analysis report generated in 109ms, dir size=195 KB
2022-07-29T16:30:32.8509962Z INFO: Analysis report compressed in 47ms, zip size=37 KB
2022-07-29T16:30:33.2059818Z INFO: Analysis report uploaded in 359ms
2022-07-29T16:30:33.2253643Z INFO: ANALYSIS SUCCESSFUL, you can browse https://sonar.server.com/dashboard?id=com.optum.ushealth.ezapp%3ABleeTest
2022-07-29T16:30:33.2255193Z INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
2022-07-29T16:30:33.2256147Z INFO: More about the report processing at https://sonar.server.com/api/ce/task?id=AYJKy5eFKOMsnbNgrQMF
2022-07-29T16:30:33.2308279Z INFO: Executing post-job 'Forbidden Configuration Breaker'
2022-07-29T16:30:33.2309273Z INFO: Executing post-job 'Quality Gate Breaker'
2022-07-29T16:30:33.9715321Z INFO: Waiting for report processing to complete...
2022-07-29T16:30:44.0949296Z INFO: Quality gate status: OK
2022-07-29T16:30:44.1192765Z INFO: Analysis total time: 29.452 s
VB.net log excerpt:
2022-08-08T19:37:12.1253735Z ##[section]Starting: Run Code Analysis
2022-08-08T19:37:12.1520769Z ==============================================================================
2022-08-08T19:37:12.1521080Z Task : Run Code Analysis
2022-08-08T19:37:12.1521338Z Description : Run scanner and upload the results to the SonarQube server.
2022-08-08T19:37:12.1521612Z Version : 5.6.1
2022-08-08T19:37:12.1521774Z Author : sonarsource
2022-08-08T19:37:12.1522279Z Help : Version: 5.6.1. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
...
2022-08-08T19:37:45.1924722Z INFO: ------------- Run sensors on project
2022-08-08T19:37:45.2076380Z INFO: Sensor VB.NET [vbnet]
2022-08-08T19:37:45.2296786Z INFO: Importing results from 5 proto files in 'C:\agent\_work\884\.sonarqube\out\0\output-vbnet'
2022-08-08T19:37:45.4456070Z INFO: Importing results from 5 proto files in 'C:\agent\_work\884\.sonarqube\out\1\output-vbnet'
2022-08-08T19:37:45.4933637Z INFO: Importing 2 Roslyn reports
2022-08-08T19:37:45.5374215Z INFO: Found 2 MSBuild VB.NET projects: 1 MAIN project. 1 TEST project.
2022-08-08T19:37:45.5374680Z INFO: Sensor VB.NET [vbnet] (done) | time=328ms
2022-08-08T19:37:45.5375031Z INFO: Sensor Zero Coverage Sensor
2022-08-08T19:37:45.5688978Z INFO: Sensor Zero Coverage Sensor (done) | time=31ms
2022-08-08T19:37:45.5878564Z INFO: CPD Executor 1 file had no CPD blocks
2022-08-08T19:37:45.5883027Z INFO: CPD Executor Calculating CPD for 1 file
2022-08-08T19:37:45.6040291Z INFO: CPD Executor CPD calculation finished (done) | time=15ms
2022-08-08T19:37:45.6128934Z INFO: Load New Code definition
2022-08-08T19:37:45.6619968Z INFO: Load New Code definition (done) | time=63ms
2022-08-08T19:37:45.7910875Z INFO: Analysis report generated in 188ms, dir size=196 KB
2022-08-08T19:37:45.8691353Z INFO: Analysis report compressed in 78ms, zip size=38 KB
2022-08-08T19:37:45.9781977Z INFO: Analysis report uploaded in 109ms
2022-08-08T19:37:45.9892794Z INFO: ANALYSIS SUCCESSFUL, you can browse https://sonar.server.com/dashboard?id=com.server.app.key%3AVBTest
2022-08-08T19:37:45.9893838Z INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
2022-08-08T19:37:45.9895367Z INFO: More about the report processing at https://sonar.server.com/api/ce/task?id=AYJ-9pZTKOMsnbNgr-Lp
2022-08-08T19:37:45.9926041Z INFO: Executing post-job 'Forbidden Configuration Breaker'
2022-08-08T19:37:45.9926715Z INFO: Executing post-job 'Quality Gate Breaker'
2022-08-08T19:37:46.6924343Z INFO: Waiting for report processing to complete...
2022-08-08T19:37:56.8460116Z INFO: Quality gate status: OK
2022-08-08T19:37:56.8693669Z INFO: Analysis total time: 25.703 s

SonarQube not showing output

I have a Kotlin project that I'm trying to analyse using SonarQube but I'm not getting any output on SonarQube after running the analyses using sonar-scanner.
Here is what my sonar-scanner.properties file looks like:
sonar.projectKey=my:Project
sonar.projectName=MyProject
sonar.projectVersion=1.0
Here is the output of running the "sonar-scanner" command in my root directory:
INFO: Scanner configuration file: /opt/sonarscanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/mshah134/Documents/Clients/sonar-project.properties
INFO: SonarQube Scanner 4.2.0.1873
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Mac OS X 10.14.6 x86_64
INFO: User cache: /Users/mshah134/.sonar/cache
INFO: SonarQube server 8.0.0
INFO: Default locale: "en_AE", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=41ms
INFO: Server id: BF41A1F2-AW5-Bdo2nCvd9XLOhxPQ
INFO: User cache: /Users/mshah134/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=31ms
INFO: Load/download plugins (done) | time=76ms
INFO: Process project properties
INFO: Process project properties (done) | time=1ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Project key: my:Project
INFO: Base dir: /Users/mshah134/Documents/Clients/
INFO: Working dir: /Users/mshah134/Documents/Clients/.scannerwork
INFO: Load project settings for component key: 'my:Project'
INFO: Load project settings for component key: 'my:Project' (done) | time=11ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=31ms
INFO: Load active rules
INFO: Load active rules (done) | time=1018ms
INFO: Indexing files...
INFO: Project configuration:
INFO: 806 files indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for kotlin: Sonar way
INFO: Quality profile for web: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: ------------- Run sensors on module MyProject
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=19ms
INFO: Using JAXBContext implementation: com.sun.xml.bind.v2.runtime.JAXBContextImpl
INFO: Sonargraph Integration: Custom metrics file '/Users/mshah134/.sonargraphintegration/metrics.properties' not found
INFO: Sonargraph Integration: Created 53 predefined and 0 custom metric(s)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/Users/mshah134/.sonar/cache/866bb1adbf016ea515620f1aaa15ec53/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=5ms
INFO: Sensor Kotlin Sensor [kotlin]
INFO: 305 source files to be analyzed
INFO: Load project repositories
INFO: Load project repositories (done) | time=8ms
INFO: Sensor Kotlin Sensor [kotlin] (done) | time=3815ms
INFO: 305/305 source files have been analyzed
INFO: Sensor JavaXmlSensor [java]
INFO: 290 source files to be analyzed
INFO: Sensor JavaXmlSensor [java] (done) | time=1077ms
INFO: 290/290 source files have been analyzed
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=351ms
INFO: Sensor XML Sensor [xml]
INFO: 290 source files to be analyzed
INFO: Sensor XML Sensor [xml] (done) | time=888ms
INFO: 290/290 source files have been analyzed
INFO: Sensor Sonargraph Integration [sonargraphintegration]
INFO: Sonargraph Integration: Processing SonarQube project 'my:Project'
WARN: Sonargraph Integration: XML report file '/Users/mshah134/Documents/Clients/target/sonargraph/sonargraph-sonarqube-report.xml' not found
INFO: Sonargraph Integration: Finished processing SonarQube project 'my:Project'
INFO: Sensor Sonargraph Integration [sonargraphintegration] (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=78ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 596 source files to be analyzed
INFO: SCM Publisher 594/596 source files have been analyzed (done) | time=3632ms
WARN: Missing blame information for the following files:
WARN: * HTML_Report.html
WARN: * XML_Report.xml
WARN: This may lead to missing/broken features in SonarQube
INFO: CPD Executor 57 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 249 files
INFO: CPD Executor CPD calculation finished (done) | time=108ms
INFO: Analysis report generated in 284ms, dir size=3 MB
INFO: Analysis report compressed in 1236ms, zip size=1 MB
INFO: Analysis report uploaded in 87ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=my%3AProject
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://localhost:9000/api/ce/task?id=AW6MaqELqw9TfdaFvBVY
INFO: Analysis total time: 16.050 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 16.766s
INFO: Final Memory: 15M/64M
INFO: ------------------------------------------------------------------------
However, on SonarQube, I only see the following:
Here is what I get at the background tasks page:
And here is the output I get when I click the "Show Scanner Context" option:
SonarQube plugins:
- SonarPython 1.16.0.4432 (python)
- SonarCSS 1.1.1.1010 (cssfamily)
- JaCoCo 1.0.2.475 (jacoco)
- SonarGo 1.6.0.719 (go)
- SonarKotlin 1.5.0.315 (kotlin)
- Swift (Backelite) 0.4.5 (backelitesonarswiftplugin)
- 3D Code Metrics 3.7 (citymodel)
- Svn 1.9.0.1295 (scmsvn)
- SonarJS 5.2.1.7778 (javascript)
- SonarRuby 1.5.0.315 (ruby)
- SonarScala 1.5.0.315 (sonarscala)
- SonarC# 7.17.0.9346 (csharp)
- SonarJava 5.14.0.18788 (java)
- Sonargraph Integration 4.0.0 (sonargraphintegration)
- SonarHTML 3.2.0.2082 (web)
- Git 1.9.1.1834 (scmgit)
- SonarFlex 2.5.1.1831 (flex)
- SonarXML 2.0.1.2020 (xml)
- SonarPHP 3.2.0.4868 (php)
- SonarTS 1.9.0.3766 (typescript)
- SonarVB 7.17.0.9346 (vbnet)
Global server settings:
- sonar.core.id=BF41A1F2-AW5-Bdo2nCvd9XLOhxPQ
- sonar.core.startTime=2019-11-21T09:00:08+0400
Project server settings:
Project scanner properties:
- sonar.host.url=http://localhost:9000
- sonar.projectBaseDir=/Users/mshah134/Documents/Clients/
- sonar.projectKey=my:Project
- sonar.projectName=MyProject
- sonar.projectVersion=1.0
- sonar.scanner.app=ScannerCli
- sonar.scanner.appVersion=4.2.0.1873
- sonar.sourceEncoding=UTF-8
- sonar.working.directory=/Users/mshah134/Documents/Clients/.scannerwork
Figured it out.
Basically it was a permissions issue.
I had originally installed sonar-qube and the sonar scanner in /opt. When I ran the sonar scanner from another directory, it had problems pushing the files onto the local sonar-qube server.
I removed the sonar-scanner entry from /etc/paths, and placed all sonarqube and sonarscanner files in the ~/Documents folder.
I then did a chmod recursively on the folders, re-added the new location for sonar-scanner in /etc/paths and started up the sonar-qube server again.
Everything worked fine then. :)

how to inject sonar-project.properties into msbuild in sonarqube

I have a c-sharp solution (say sample.sln), but to run sonarqube analysis, as per the docs, i have run the following command:
".\3rdparty\sonarqube\msbuild\SonarScanner.MSBuild.exe" begin /k:"comm"
/n:"comm" /v:"2.0"
/d:sonar.cs.dotcover.reportsPaths=
"D:\Jenkins\workspace\comm\TEST\CoverageReport.html"
/d:sonar.host.url="http://101.149.24.128"
/d:sonar.sources="D:\Jenkins\workspace\comm\source\*.cs"
msbuild comm.sln /t:Rebuild
".\3rdparty\sonarqube\msbuild\SonarScanner.MSBuild.exe" end
but getting this error :
SONAR_SCANNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
Calling the SonarQube Scanner...
INFO: Scanner configuration file: D:\Jenkins\workspace\comm\3rdparty\sonarqube\msbuild\sonar-scanner-3.2.0.1227\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: D:\Jenkins\workspace\comm\.sonarqube\out\sonar-project.properties
INFO: SonarQube Scanner 3.2.0.1227
INFO: Java 1.8.0_151 Oracle Corporation (64-bit)
INFO: Windows Server 2016 10.0 amd64
INFO: SONAR_SCANNER_OPTS=-Xmx1024m
INFO: User cache: C:\Users\jenkins\.sonar\cache
INFO: SonarQube server 6.7.5
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Publish mode
INFO: Load global settings
INFO: Load global settings (done) | time=278ms
INFO: Server id: 7950B4AD-AWYRoMpRpurWib7aM-qP
INFO: User cache: C:\Users\jenkins\.sonar\cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=84ms
INFO: Process project properties
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 13.565s
INFO: Final Memory: 6M/84M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to load component class org.sonar.scanner.scan.ProjectLock
ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.DefaultInputModuleHierarchy
ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.ProjectBuildersExecutor
ERROR: Caused by: Unable to load component class com.talanlabs.sonar.plugins.gitlab.CommitProjectBuilder
ERROR: Caused by: Unable to load component class com.talanlabs.sonar.plugins.gitlab.GitLabPluginConfiguration
ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.MutableProjectSettings
ERROR: Caused by: Unable to load component class org.sonar.api.batch.bootstrap.ProjectReactor
**ERROR: Caused by: Illegal char <*> at index 43: D:\Jenkins\workspace\comm\source\*.cs**
ERROR:
The SonarQube Scanner did not complete successfully
so i thought of adding, all the sonar related properties into sonar-project.properties, and kept inside the project root folder, and ran the analysis. but got an error below.
sonar-project.properties files are not understood by the SonarScanner for MSBuild. Remove those files from the following folders: D:\Jenkins\workspace\comm
have looked at this question
what i could infer from this post is, we cannot set sonar-project.properties for msbuild ? is it ?
So then how to do include/exclude files/folders from code coverage in sonar analysis ? I don't have admin access, to set administrative global exclusions
Any help ?
P.S using sonarqube LTS 6.7.6

Trying to Use MSBuild SonarQube and unable to make it work

I have been using SonarQube for code analyzing at a basic level however now I would like to measure the code against FX-COP rules. Hence I am attempting to use MSBuild SonarQube scanner. I read the documentation thoroughly and have setup my project likewise however when I execute it gives me error.
Below is the extract from the log:
MSBuild SonarQube Runner Bootstrapper 1.0.2.0
Default properties file was found at C:\....\1c36691bf5270463\SonarQube.Analysis.xml
Loading analysis properties from C:\....\1c36691bf5270463\SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
Checking for updates...
MSBuild SonarQube Runner Pre-processor 1.0.2.0
Loading analysis properties from C:\...\1c36691bf5270463\SonarQube.Analysis.xml
Updating build integration targets...
Fetching analysis configuration settings...
Generating rulesets...
Pre-processing succeeded.
Microsoft (R) Build Engine version 12.0.21005.1
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
Build started 11/20/2015 1:46:41 PM.
Project "C:\Project1.sln" on node 1 (rebuild target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Build succeeded.
9 Warning(s)
0 Error(s)
Time Elapsed 00:01:07.86
MSBuild SonarQube Runner Bootstrapper 1.0.2.0
Default properties file was found at C:\...\1c36691bf5270463\SonarQube.Analysis.xml
Loading analysis properties from C:\...\1c36691bf5270463\SonarQube.Analysis.xml
Post-processing started.
MSBuild SonarQube Runner Post-processor 1.0.2.0 gives several warnings similar to one below:
WARNING: File is not under the project directory and cannot currently be analysed
by SonarQube.
File: C:\Users\...\AppData\Local\Temp\2\.NETFramework,Version=v4.0.AssemblyAttributes.cs,
project: C:\...\1c36691bf5270463\SOURCE\x\y.csproj**
Calling the sonar-runner:
SONAR_RUNNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
C:\...\1c36691bf5270463\.sonarqube\bin\sonar-runner\bin\..
SonarQube Runner 2.4
Java 1.8.0_51 Oracle Corporation (64-bit)
Windows Server 2008 R2 6.1 amd64
SONAR_RUNNER_OPTS=-Xmx1024m
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\...\1c36691bf5270463\.sonarqube\bin\sonar-runner\bin\..\conf\sonar-runner.properties
INFO: Project configuration file: C:\TeamCity\buildAgent\work\1c36691bf5270463\.sonarqube\out\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\...\1c36691bf5270463\.sonarqube\out\.sonar
INFO: SonarQube Server 5.1.1
13:47:51.150 INFO - Load global repositories
13:47:51.743 INFO - Load global repositories (done) | time=593ms
13:47:51.758 INFO - Server id: 20151120125423
13:47:51.758 INFO - User cache: C:\...\cache
13:47:51.758 INFO - Install plugins
13:47:51.836 INFO - Install JDBC driver
.
.
.
13:47:55.518 INFO - ------------- Scan file1
13:47:55.534 INFO - Load module settings
13:47:55.658 INFO - Load rules
13:47:56.017 INFO - Base dir: C:\...\1c36691bf5270463\SOURCE\xxx
13:47:56.017 INFO - Working dir: C:\...\1c36691bf5270463\.sonarqube\out\.sonar\AC1_AC1_497EBFF2-C710-4843-8263-F534AF803D3E
13:47:56.017 INFO - Source encoding: UTF-8, default locale: en_US
13:47:56.532 INFO - Quality profile for cs: Sonar way
13:48:00.635 INFO - Sensor org.sonar.plugins.csharp.CSharpFxCopProvider$CSharpFxCopSensor#73c82ec1
INFO: -----------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: -----------------------------------------------------------------
Total time: 10.156s
Final Memory: 16M/306M
INFO: -----------------------------------------------------------------
13:48:00.791 Creating a summary markdown file...
Press any key to continue . . .
You need to run all your commands in a Developer Command Prompt for Visual Studio 2013 or higher and:
use at least MSBuild 12.0
have .NET 4.5.2+ installed
You have this error because the FxCop Results are not generated.
Do you see in the MSBuild's logs, execution of FxCop? This is visible inside the RunCodeAnalysis section of MSBuild's logs.
You need to run this from command line and use the "-X" flag on your command, this will give you verbose debugging, I would highly reccomend doing the following for troubleshooting.
sonar-runner.exe <arg> <arg> -X > sonar-runnerLog.txt
Then read or dump that log back here. either way you'll know a lot more about what the actual problem is.
You can get Visual Studio Express 2013 (or 15) for free and both of those come with their respective developer command prompts.

Sonar for Eclipse: unable to run local analysis

I have successfully installed sonar plug-in for eclipse, however when I try to 'Run Local Analysis' for sonar, eclipse gives an error saying:
An internal error occurred during: "Sonar Analysis".
Unable to create markers
and console for Sonar has following info printed:
Usage: javaw [-options] class [args...]
(to execute a class)
or javaw [-jar] [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath
set search path for application classes and resources
-D=
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-version:
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-agentlib:[=]
load native agent library , e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:[=]
load native agent library by full pathname
-javaagent:[=]
load Java programming language agent, see java.lang.instrument
-? -help print this help message
-X print help on non-standard options
-splash: show splash screen with specified image
-ea[:...|:]
-enableassertions[:...|:]
enable assertions
-da[:...|:]
-disableassertions[:...|:]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
Plz help with how to proceed for Local analysis in eclipse.
[Update: Version Details]
Eclipse: Indigo (3.7.1)
Sonar Plug-in: 3.0.0
Sonar(Server): 3.4.1
Sonar Web Service Client: 3.4.0
Java: 1.4.1 ('Java EE IDE' property in Eclipse Features)
Local Java Installation: 1.6