New Msbuild Sonar runner is skipping analysis for .net projects - sonarqube

I have setup new Msbuild sonar runner and kickoff analysis for a project type "class library". It went successful. To test it further,
I have created one more project which has only one file with 5 Interface definitions.
I made sure that names of interfaces NOT started with letter 'i'.
I created a quality profile with one stylecop rule i.e. "Interface names must begin with i".
I started cmd prompt (VS command prompt) and change it's path to the directory which has .csproj file. Clearly I am NOT at .sln file level. precisely one more level down where we can see .csproj file.
Fired Begin - msbuild -end sequence.
It shows ANALYSIS SUCCESSFUL but when I don't see any issues on dashboard ( Issues zero where as I expect 5, each one is for one interface).
After careful observation of Log, It shows following message. I am not sure that I quite understand it.
WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\raja.moparthi\AppData\Local\Temp.NETFramework,Version=v4.5.AssemblyAttributes.cs, project: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\TestFib2.csproj
Please let me know what is going wrong here.
Begin command Log given below :
Default properties file was found at D:\MsBuildSonarQubeRunner\SonarQube.Analysis.xml
Loading analysis properties from D:\MsBuildSonarQubeRunner\SonarQube.Analysis.xml
Pre-processing started.
Using environment variables to determine the download directory...
Removing the existing directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube
Creating directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube
Creating directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\bin
SonarQube server url: http://{SonarQube ServerName: I removed it}:9000/
Downloading SonarQube.MSBuild.Runner.Implementation.zip from http://{SonarQube ServerName: I removed it}/static/csharp/SonarQube.MSBuild.Runner.Implementation.zip to D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\bin\SonarQube.MSBuild.Runner.Implementation.zip
Executing file D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\bin\MSBuild.SonarQube.Internal.PreProcess.exe
Args: "/k:FibTest" "/n:FibTestAnalysis" "/v:1.0.0.0" "/s:D:\MsBuildSonarQubeRunner\SonarQube.Analysis.xml"
Working directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube
Timeout (ms):-1
Process id: 4692
10:51:21 PM Loading analysis properties from D:\MsBuildSonarQubeRunner\SonarQube.Analysis.xml
10:51:21 PM The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\raja.moparthi\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportBefore
10:51:21 PM The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\raja.moparthi\AppData\Local\Microsoft\MSBuild\12.0\Microsoft.Common.targets\ImportBefore
10:51:21 PM The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\raja.moparthi\AppData\Local\Microsoft\MSBuild\4.0\Microsoft.Common.targets\ImportBefore
10:51:21 PM Not running under TeamBuild
10:51:21 PM Analysis base directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube
Build directory:
Bin directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\bin
Config directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\conf
Output directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out
Config file: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out
10:51:21 PM Creating config and output folders...
10:51:21 PM Creating directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\conf
10:51:21 PM Creating directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out
10:51:21 PM Generating the FxCop ruleset: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\conf\SonarQubeFxCop-cs.ruleset
10:51:22 PM Generating the FxCop ruleset: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\conf\SonarQubeFxCop-vbnet.ruleset
10:51:22 PM Saving the config file to D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\conf\SonarQubeAnalysisConfig.xml
Process returned exit code 0
Pre-processing succeeded.
----------------
Msbuild command log is given below.
Microsoft (R) Build Engine version 12.0.21005.1
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 9/8/2015 10:51:36 PM.
Project "D:\SonarQube-Test-Projects\Fibanocci\TestFib2\TestFib2.csproj" on node 1 (default targets).
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
_CopyAppConfigFile:
Skipping target "_CopyAppConfigFile" because all output files are up-to-date with respect to the input files.
CopyFilesToOutputDirectory:
TestFib2 -> D:\SonarQube-Test-Projects\Fibanocci\TestFib2\bin\Debug\TestFib2.exe
OverrideCodeAnalysisProperties:
Skipping FxCop analysis: the SonarQube ruleset does not exist. Ruleset: D:\SonarQube-Test-Projects\Fibanocci
\TestFib2\.sonarqube\conf\\SonarQubeFxCop-cs.ruleset
Skipping FxCop analysis: the project is a test project
SetStyleCopAnalysisSettings:
Setting 'sonar.stylecop.projectFilePath' to 'D:\SonarQube-Test-Projects\Fibanocci\TestFib2\TestFib2.csproj'
WriteSonarQubeProjectData:
Directory "D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out\\TestFib2__AnyCPU_Debug_635773494965392474" doesn't exist. Skipping.
Creating directory "D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out\\TestFib2__AnyCPU_Debug_635773494965392474".
Done Building Project "D:\SonarQube-Test-Projects\Fibanocci\TestFib2\TestFib2.csproj" (default targets).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.32
End
----------------
End command log is given below.
Default properties file was found at D:\MsBuildSonarQubeRunner\SonarQube.Analysis.xml
Loading analysis properties from D:\MsBuildSonarQubeRunner\SonarQube.Analysis.xml
Post-processing started.
Using environment variables to determine the download directory...
Executing file D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\bin\MSBuild.SonarQube.Internal.PostProcess.exe
Args:
Working directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube
Timeout (ms):-1
Process id: 8528
10:51:54 PM Not running under TeamBuild
10:51:54 PM Analysis base directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube
Build directory:
Bin directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\bin
Config directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\conf
Output directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out
Config file: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out
10:51:54 PM Loading the SonarQube analysis config from D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\conf\SonarQubeAnalysisConfig.xml
10:51:54 PM Generating SonarQube project properties file to D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out\sonar-project.properties
10:51:54 PM WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\raja.moparthi\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.cs, project: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\TestFib2.csproj
10:51:54 PM Writing processing summary to D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out\ProjectInfo.log
10:51:54 PM Creating directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\bin\sonar-runner
10:51:54 PM The SONAR_RUNNER_HOME environment variable is not required and will be ignored.
10:51:54 PM Calling the sonar-runner...
10:51:54 PM SONAR_RUNNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
10:51:54 PM Setting environment variable 'SONAR_RUNNER_OPTS'. Value: -Xmx1024m
10:51:54 PM Executing file D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\bin\sonar-runner\bin\sonar-runner.bat
Args: -Dproject.settings="D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out\sonar-project.properties"
Working directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\bin\sonar-runner\bin
Timeout (ms):-1
Process id: 11196
10:51:54 PM D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\bin\sonar-runner\bin\..
10:51:54 PM SonarQube Runner 2.4
10:51:54 PM Java 1.8.0_60 Oracle Corporation (64-bit)
10:51:54 PM Windows 7 6.1 amd64
10:51:54 PM SONAR_RUNNER_OPTS=-Xmx1024m
10:51:54 PM INFO: Runner configuration file: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\bin\sonar-runner\bin\..\conf\sonar-runner.properties
10:51:54 PM INFO: Project configuration file: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out\sonar-project.properties
10:51:54 PM INFO: Default locale: "en_US", source code encoding: "UTF-8"
10:51:54 PM INFO: Work directory: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out\.sonar
10:51:55 PM INFO: SonarQube Server 5.0.1
10:51:56 PM 22:51:56.238 INFO - Load global referentials...
10:51:57 PM 22:51:57.049 INFO - Load global referentials done: 813 ms
10:51:57 PM 22:51:57.055 INFO - User cache: C:\Users\raja.moparthi\.sonar\cache
10:51:57 PM 22:51:57.065 INFO - Install plugins
10:51:57 PM 22:51:57.390 INFO - Install JDBC driver
10:51:57 PM 22:51:57.600 INFO - Create JDBC datasource for jdbc:jtds:sqlserver://{DB server- I removed original server name for security purpose}/sonar;SelectMethod=Cursor
10:52:04 PM 22:52:04.530 INFO - Initializing Hibernate
10:52:07 PM 22:52:07.162 INFO - Load project referentials...
10:52:10 PM 22:52:10.353 INFO - Load project referentials done: 3191 ms
10:52:10 PM 22:52:10.354 INFO - Load project settings
10:52:10 PM 22:52:10.884 INFO - Loading technical debt model...
10:52:11 PM 22:52:11.930 INFO - Loading technical debt model done: 1046 ms
10:52:11 PM 22:52:11.936 INFO - Apply project exclusions
10:52:20 PM 22:52:20.949 WARN - SCM provider autodetection failed. No SCM provider claims to support this project. Please use sonar.scm.provider to define SCM of your project.
10:52:20 PM 22:52:20.951 INFO - ------------- Scan TestFib2
10:52:20 PM 22:52:20.955 INFO - Load module settings
10:52:57 PM 22:52:57.308 INFO - Loading rules...
10:53:07 PM 22:53:07.904 INFO - Loading rules done: 10596 ms
10:53:08 PM 22:53:08.100 INFO - Configure Maven plugins
10:53:10 PM 22:53:10.219 INFO - Compare to previous analysis (2015-09-08)
10:53:10 PM 22:53:10.439 INFO - Compare over 30 days (2015-08-09, analysis of 2015-09-08 21:09:01.457)
10:53:10 PM 22:53:10.441 INFO - No quality gate is configured.
10:53:10 PM 22:53:10.513 INFO - Base dir: D:\SonarQube-Test-Projects\Fibanocci\TestFib2
10:53:10 PM 22:53:10.514 INFO - Working dir: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out\.sonar\FibTest_FibTest_B51D1FBF-8925-45C4-B8C8-5DBE2F60DBCE
10:53:10 PM 22:53:10.518 INFO - Test paths: Program.cs, Properties/AssemblyInfo.cs, App.config
10:53:10 PM 22:53:10.519 INFO - Source encoding: UTF-8, default locale: en_US
10:53:10 PM 22:53:10.519 INFO - Index files
10:53:10 PM 22:53:10.576 INFO - 2 files indexed
10:53:15 PM 22:53:15.923 INFO - Quality profile for cs: Mks Test Rules
10:53:15 PM 22:53:15.949 INFO - Sensor QProfileSensor...
10:53:15 PM 22:53:15.961 INFO - Sensor QProfileSensor done: 12 ms
10:53:15 PM 22:53:15.961 INFO - Sensor InitialOpenIssuesSensor...
10:53:17 PM 22:53:17.547 INFO - Sensor InitialOpenIssuesSensor done: 1586 ms
10:53:17 PM 22:53:17.548 INFO - Sensor ProjectLinksSensor...
10:53:18 PM 22:53:18.541 INFO - Sensor ProjectLinksSensor done: 993 ms
10:53:19 PM 22:53:19.130 INFO - Sensor VersionEventsSensor...
10:53:21 PM 22:53:21.896 INFO - Sensor VersionEventsSensor done: 2766 ms
10:53:21 PM 22:53:21.896 INFO - Sensor FileHashSensor...
10:53:21 PM 22:53:21.904 INFO - Sensor FileHashSensor done: 8 ms
10:53:21 PM 22:53:21.904 INFO - Sensor SCM Sensor...
10:53:21 PM 22:53:21.904 INFO - No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
10:53:21 PM 22:53:21.904 INFO - Sensor SCM Sensor done: 0 ms
10:53:21 PM 22:53:21.904 INFO - Sensor CPD Sensor...
10:53:21 PM 22:53:21.905 INFO - DefaultCpdEngine is used for cs
10:53:21 PM 22:53:21.906 INFO - Sensor CPD Sensor done: 2 ms
10:53:22 PM 22:53:22.118 INFO - Execute decorators...
10:53:28 PM 22:53:28.033 INFO - ------------- Scan FibTestAnalysis
10:53:28 PM 22:53:28.039 INFO - Load module settings
10:53:28 PM 22:53:28.086 INFO - Configure Maven plugins
10:53:28 PM 22:53:28.291 INFO - Compare to previous analysis (2015-09-08)
10:53:28 PM 22:53:28.491 INFO - Compare over 30 days (2015-08-09, analysis of 2015-09-08 21:09:01.457)
10:53:28 PM 22:53:28.493 INFO - No quality gate is configured.
10:53:28 PM 22:53:28.518 INFO - Base dir: D:\SonarQube-Test-Projects\Fibanocci\TestFib2
10:53:28 PM 22:53:28.518 INFO - Working dir: D:\SonarQube-Test-Projects\Fibanocci\TestFib2\.sonarqube\out\.sonar
10:53:28 PM 22:53:28.518 INFO - Source encoding: UTF-8, default locale: en_US
10:53:29 PM 22:53:29.121 INFO - Sensor InitialOpenIssuesSensor...
10:53:30 PM 22:53:30.301 INFO - Sensor InitialOpenIssuesSensor done: 1180 ms
10:53:30 PM 22:53:30.302 INFO - Sensor ProjectLinksSensor...
10:53:30 PM 22:53:30.893 INFO - Sensor ProjectLinksSensor done: 591 ms
10:53:31 PM 22:53:31.483 INFO - Sensor VersionEventsSensor...
10:53:33 PM 22:53:33.659 INFO - Sensor VersionEventsSensor done: 2176 ms
10:53:33 PM 22:53:33.659 INFO - Sensor FileHashSensor...
10:53:33 PM 22:53:33.660 INFO - Sensor FileHashSensor done: 1 ms
10:53:33 PM 22:53:33.660 INFO - Sensor SCM Sensor...
10:53:33 PM 22:53:33.660 INFO - No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
10:53:33 PM 22:53:33.660 INFO - Sensor SCM Sensor done: 0 ms
10:53:33 PM 22:53:33.660 INFO - Sensor CPD Sensor...
10:53:33 PM 22:53:33.660 INFO - Sensor CPD Sensor done: 0 ms
10:53:33 PM 22:53:33.774 INFO - Execute decorators...
10:53:37 PM 22:53:37.356 INFO - Store results in database
10:53:42 PM 22:53:42.464 INFO - ANALYSIS SUCCESSFUL, you can browse http://{ server- I removed original server name for security purpose}:9000/dashboard/index/FibTest
10:53:42 PM 22:53:42.464 INFO - Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report.
10:53:42 PM 22:53:42.465 INFO - Executing post-job class org.sonar.plugins.core.issue.notification.SendIssueNotificationsPostJob
10:53:44 PM INFO: ------------------------------------------------------------------------
10:53:44 PM INFO: EXECUTION SUCCESS
10:53:44 PM INFO: ------------------------------------------------------------------------
10:53:44 PM Total time: 1:49.413s
10:53:44 PM Final Memory: 14M/457M
10:53:44 PM INFO: ------------------------------------------------------------------------
10:53:44 PM Process returned exit code 0
10:53:44 PM The sonar-runner has finished
10:53:44 PM Creating a summary markdown file...
10:53:44 PM Analysis results: http://{ server- I removed original server name for security purpose}:9000/dashboard/index/FibTest
Process returned exit code 0
Post-processing succeeded.

Thanks for providing all these valuable details in your questions, which makes it easier to answer.
First of all, you can safely ignore the message C:\Users\raja.moparthi\AppData\Local\Temp.NETFramework,Version=v4.5.AssemblyAttributes.cs : That file does not belong to your project, and does not have to be analyzed.
Then, I think that you are facing a limitation of the MSBuild SonarQube Runner 1.0 release, which is already fixed in the soon to be released 1.0.1 version: If the full path to your .csproj file contains test, the project will be detected as a test one, and SonarQube doesn't report issues on tests projects. See this tickets for details: https://jira.sonarsource.com/browse/SONARMSBRU-121 While waiting on this new release, the easiest thing you can do is simply to remove test from the folder names.

I still have the issue described by Dinesh using TFS' SonarQube Extension 2.0.0, which embeds SonarQube Scanner for MSBuild 2.2.0.24:
If the full path to your .csproj file contains test, the project will be detected as a test one, and SonarQube doesn't report issues on tests projects.
I've solved it by customizing the Test project pattern in Sonar Qube's Administration | Configuration | General Settings | Scanner for MSBuild.

Related

SonarQube does not detect C# issues in Xamarin project

I want to use SonarQube to analyze C# code of a Xamarin.Forms project with an Android and iOS app. For that I created a demo app containing code issues taken from the SonarQube examples. However, these issues are not detected by SonarQube after scanning the code. What am I doing wrong?
I followed these instructions and installed on macOS Sierra:
SonarQube 6.7 LTS
SonarQube Scanner for MSBuild 4.0.1.883
SonarC# analyzer plugin 6.7 (build 4267)
To build the project I use msbuild 15.2.0.0 that comes with Xamarin.
On the terminal I change my directory to cd /SonarQubeXamarinDemo/SonarQube and run the following commands.
mono /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/MSBuild.SonarQube.Runner.exe begin /k:"test" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="***"
Default properties file was found at /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/SonarQube.Analysis.xml
Loading analysis properties from /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
15:14:24.778 Updating build integration targets...
15:14:24.796 Fetching analysis configuration settings...
15:14:25.164 Provisioning analyzer assemblies for cs...
15:14:25.165 Installing required Roslyn analyzers...
15:14:25.225 Pre-processing succeeded.
msbuild /t:Rebuild
...
mono /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/MSBuild.SonarQube.Runner.exe end
SonarQube Scanner for MSBuild 4.0.1
Default properties file was found at /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/SonarQube.Analysis.xml
Loading analysis properties from /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/SonarQube.Analysis.xml
Post-processing started.
SONAR_SCANNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
Calling the SonarQube Scanner...
INFO: Scanner configuration file: /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/sonar-scanner-3.0.3.778/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/.sonarqube/out/sonar-project.properties
INFO: SonarQube Scanner 3.0.3.778
INFO: Java 1.8.0_91 Oracle Corporation (64-bit)
INFO: Mac OS X 10.12.6 x86_64
INFO: SONAR_SCANNER_OPTS=-Xmx1024m
INFO: User cache: /Users/christopher/.sonar/cache
INFO: Publish mode
INFO: Load global settings
INFO: Load global settings (done) | time=92ms
INFO: Server id: AWBqDLDnW0cFaKeFAIpa
INFO: User cache: /Users/christopher/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=47ms
INFO: SonarQube server 6.7.0
INFO: Default locale: "de_DE", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=104ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=28ms
INFO: Load active rules
INFO: Load active rules (done) | time=418ms
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=21ms
INFO: Project key: test
INFO: ------------- Scan SonarQube.iOS
INFO: Load server rules
INFO: Load server rules (done) | time=116ms
INFO: Base dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/iOS
INFO: Working dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/.sonarqube/out/.sonar/test_test_6E8E4F09-4D51-490F-A002-4E844C8CEC18
INFO: Source encoding: UTF-8, default locale: de_DE
INFO: Index files
INFO: 0 files indexed
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=0ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=3ms
INFO: ------------- Scan SonarQube.Droid
INFO: Base dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/Droid
INFO: Working dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/.sonarqube/out/.sonar/test_test_E9EA7651-B0E9-4DAD-9256-A858860C4022
INFO: Source encoding: UTF-8, default locale: de_DE
INFO: Index files
INFO: 0 files indexed
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=0ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=1ms
INFO: ------------- Scan SonarQube
INFO: Base dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/SonarQube
INFO: Working dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/.sonarqube/out/.sonar/test_test_9200C6D4-CA74-49DD-910F-6DAF012CCCDF
INFO: Source encoding: UTF-8, default locale: de_DE
INFO: Index files
INFO: 0 files indexed
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=1ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=0ms
INFO: ------------- Scan test
INFO: Base dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube
INFO: Working dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/.sonarqube/out/.sonar
INFO: Source paths: SonarQube/SonarQube.cs, SonarQube/Properties/AssemblyInfo.cs, SonarQube/packages.config, iOS/Main.cs, iOS/AppDelegate.cs, iOS/Info.plist, iOS/Entitlements.plist, iOS/packages.config, Droid/MainActivity.cs, Droid/Resources/Resource.designer.cs, Droid/Properties/AssemblyInfo.cs, Droid/Resources/AboutResources.txt, Droid/Properties/AndroidManifest.xml, Droid/Assets/AboutAssets.txt, Droid/packages.config
INFO: Source encoding: UTF-8, default locale: de_DE
INFO: Index files
INFO: 15 files indexed
INFO: Quality profile for cs: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor SonarJavaXmlFileSensor [java]
WARNING: WARN: Property missing: 'sonar.cs.analyzer.projectOutPaths'. No protobuf files will be loaded for this project.
WARNING: WARN: No roslyn issues report not found for this project.
INFO: 1 source files to be analyzed
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=62ms
INFO: 1/1 source files have been analyzed
INFO: Sensor XML Sensor [xml]
INFO: Sensor XML Sensor [xml] (done) | time=211ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=0ms
INFO: Sensor C# [csharp]
INFO: Sensor C# [csharp] (done) | time=0ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=11ms
INFO: Sensor CPD Block Indexer
INFO: Sensor CPD Block Indexer (done) | time=0ms
INFO: SCM provider for this project is: git
INFO: 8 files to be analyzed
INFO: 0/8 files analyzed
WARNING: WARN: Missing blame information for the following files:
WARNING: WARN: * Droid/MainActivity.cs
WARNING: WARN: * Droid/Properties/AndroidManifest.xml
WARNING: WARN: * Droid/Properties/AssemblyInfo.cs
WARNING: WARN: * Droid/Resources/Resource.designer.cs
WARNING: WARN: * SonarQube/Properties/AssemblyInfo.cs
WARNING: WARN: * SonarQube/SonarQube.cs
WARNING: WARN: * iOS/AppDelegate.cs
WARNING: WARN: * iOS/Main.cs
WARNING: WARN: This may lead to missing/broken features in SonarQube
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 99ms, dir size=216 KB
INFO: Analysis reports compressed in 19ms, zip size=37 KB
INFO: Analysis report uploaded in 48ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/test
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=AWBvIYbsCU-ClqGI-H2t
INFO: Task total time: 3.392 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 4.593s
INFO: Final Memory: 49M/401M
INFO: ------------------------------------------------------------------------
The SonarQube Scanner has finished
15:15:56.62 Creating a summary markdown file...
15:15:56.627 Analysis results: http://localhost:9000/dashboard/index/test
15:15:56.628 Post-processing succeeded.
The report does not show any detected issues:
I noticed these warnings but do not know if they are relevant for the undetected code issues:
WARNING: WARN: Property missing: 'sonar.cs.analyzer.projectOutPaths'. No protobuf files will be loaded for this project.
WARNING: WARN: No roslyn issues report not found for this project.
What I tried so far to fix the issue without succeeding
setting the language to C# using /d:sonar.language=cs
I was facing the same issue. so I changed the approach as below:
sonar-scanner-msbuild-4.0.1.883\SonarQube.Scanner.MSBuild.exe begin /k:FAM
dotnet restore
dotnet build
sonar-scanner-msbuild-4.0.1.883\SonarQube.Scanner.MSBuild.exe end
So instead of using msbuild.exe you can use dotnet cli commands.

SonarQube: No analysis retrieved

I tried to run a project.
The execution was successful but there seems to not have any analysis.
The log from the command prompt is as follow:
C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-2.6.1\bin>sonar-scanner.bat
C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-2.6.1\bin\..
INFO: Scanner configuration file: C:\Users\kong-yong.tay\Desktop\Sonar\sonar-sca
nner-2.6.1\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 2.6.1
INFO: Java 1.8.0_102 Oracle Corporation (64-bit)
INFO: Windows 7 6.1 amd64
INFO: User cache: C:\Users\kong-yong.tay\.sonar\cache
INFO: Load global repositories
INFO: Load global repositories (done) | time=167ms
WARN: Property 'sonar.jdbc.url' is not supported any more. It will be ignored. T
here is no longer any DB connection to the SQ database.
INFO: User cache: C:\Users\kong-yong.tay\.sonar\cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=11ms
INFO: SonarQube server 5.6
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=173ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=87ms
INFO: Load active rules
INFO: Load active rules (done) | time=569ms
WARN: 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 Javascript Sonar Runner Simple
INFO: Language is forced to js
INFO: Load server rules
INFO: Load server rules (done) | time=325ms
INFO: Base dir: C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-2.6.1\bin
INFO: Working dir: C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-2.6.1\bin\
.sonar
INFO: Source paths: C:\Users\kong-yong.tay\Desktop\Sonar\sonar-examples-master\p
rojects\languages\javascript\javascript-sonar-runner\src
INFO: Source encoding: UTF-8, default locale: en_US
INFO: Index files
WARN: File 'C:\Users\kong-yong.tay\Desktop\Sonar\sonar-examples-master\projects\
languages\javascript\javascript-sonar-runner\src\Person.js' is ignored. It is no
t located in module basedir 'C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-
2.6.1\bin'.
INFO: 0 files indexed
INFO: Quality profile for js: Sonar way
INFO: JaCoCoSensor: JaCoCo report not found : C:\Users\kong-yong.tay\Desktop\Son
ar\sonar-scanner-2.6.1\bin\target\jacoco.exec
INFO: JaCoCoItSensor: JaCoCo IT report not found: C:\Users\kong-yong.tay\Desktop
\Sonar\sonar-scanner-2.6.1\bin\target\jacoco-it.exec
INFO: Sensor Lines Sensor
INFO: Sensor Lines Sensor (done) | time=0ms
INFO: Sensor SCM Sensor
INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property
to explicitly specify it.
INFO: Sensor SCM Sensor (done) | time=2ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=0ms
INFO: Sensor Code Colorizer Sensor
INFO: Sensor Code Colorizer Sensor (done) | time=0ms
INFO: Sensor CPD Block Indexer
INFO: DefaultCpdBlockIndexer is used for js
INFO: Sensor CPD Block Indexer (done) | time=1ms
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 72ms, dir size=11 KB
INFO: Analysis reports compressed in 14ms, zip size=4 KB
INFO: Analysis report uploaded in 86ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/
org.sonarqube:java-simple-sq-scanner
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=A
VZ3vdRUAtopFvSq_-I1
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 4.071s
INFO: Final Memory: 47M/180M
INFO: ------------------------------------------------------------------------
It ran the first time (though without any analysis results but there was a log recorded in the database). However, for the subsequent time that I've ran the test, it has already stopped the connection to the database.
Please help.
You should run SonarQube Scanner in the directory where your project is located, not from where the Scanner is stored. In short (and in your case):
> cd C:\Users\kong-yong.tay\Desktop\Sonar\sonar-examples-master\projects\languages\javascript\javascript-sonar-runner
> C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-2.6.1\bin\sonar-scanner.bat
Current situation
Currently you run it from:
INFO: Working dir: C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-2.6.1\bin\
But your code is in:
INFO: Source paths: C:\Users\kong-yong.tay\Desktop\Sonar\sonar-examples-master\projects\languages\javascript\javascript-sonar-runner\src
And since you did not explicitely set sonar.projectBaseDir (see Analysis Parameters), you end up with this warning:
WARN: File 'C:\Users\kong-yong.tay\Desktop\Sonar\sonar-examples-master\projects\
languages\javascript\javascript-sonar-runner\src\Person.js' is ignored. It is no
t located in module basedir 'C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-
2.6.1\bin'.
INFO: 0 files indexed

SonarQube 5.3 stopped analyzing Github pull requests

We have recently updated our SonarQube version from 5.0 to 5.3 and our SonarQube Scanner/Runner from 2.3 to 2.4.
During this upgrade, SonarQube has stopped analyzing our GitHub pull requests. We run the SonarQube Scanner as the last step in our jenkins job.
The command we run is as follows:
/usr/local/sonar-runner/bin/sonar-runner -Dsonar.analysis.mode=issues \
-Dsonar.github.pullRequest=${ghprbPullId} \
-Dsonar.github.repository=OurRepository/OurRepository \
-Dsonar.github.login=MyUsername \
-Dsonar.github.oauth=MyToken \
-Dsonar.login=MyUsername \
-Dsonar.password=MyPassword \
-Dsonar.sources=./app/ \
-Dsonar.projectKey=MyProject \
-Dsonar.projectName=MyProject \
-Dsonar.projectVersion=2.9.0 \
-Dsonar.exclusions=app/Vendor/**,app/Plugin/**/Test/**,app/Test/**
The only thing we changed during this upgrade is the analysis mode. Before the upgrade we used the incremental mode which has been removed in 5.2.
The output of the command is as follows:
+ /usr/local/sonar-runner/bin/sonar-runner -Dsonar.analysis.mode=issues -Dsonar.github.pullRequest=2944 -Dsonar.github.repository=OurRepository/OurRepository -Dsonar.github.login=Username -Dsonar.github.oauth=MyToken -Dsonar.login=MyUsername -Dsonar.password=MyPAsword -Dsonar.sources=./app/ -Dsonar.projectKey=MyProject -Dsonar.projectName=MyProject -Dsonar.projectVersion=2.9.0 '-Dsonar.exclusions=app/Vendor/**,app/Plugin/**/Test/**,app/Test/**'
SonarQube Runner 2.4
Java 1.7.0_101 Oracle Corporation (64-bit)
Linux 3.10.0-327.13.1.el7.x86_64 amd64
INFO: Runner configuration file: /usr/local/sonar-runner/conf/sonar-runner.properties
INFO: Project configuration file: /projectpath/sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: /projectpath/./.sonar
INFO: SonarQube Server 5.3
12:54:00.422 INFO - Load global repositories
12:54:00.927 INFO - Load global repositories (done) | time=505ms
12:54:00.988 INFO - User cache: /projectpath/.sonar/cache
12:54:01.016 INFO - Exclude plugins: devcockpit, jira, pdfreport, views, report, buildstability, buildbreaker, scmstats
12:54:01.417 INFO - Load plugins index
12:54:01.431 INFO - Load plugins index (done) | time=14ms
12:54:02.121 INFO - Found project [MyProject] cache [Thu May 19 11:29:15 CEST 2016]
12:54:02.280 INFO - Process project properties
12:54:02.723 INFO - Load project repositories
12:54:03.461 INFO - Load project repositories (done) | time=738ms
12:54:03.485 INFO - Apply project exclusions
12:54:03.629 INFO - Load quality profiles
12:54:04.348 INFO - Load quality profiles (done) | time=719ms
12:54:04.357 INFO - Load active rules
12:54:09.383 INFO - Load active rules (done) | time=5026ms
12:54:09.401 INFO - Issues mode
12:54:09.401 INFO - Scanning only changed files
12:54:09.405 INFO - ------------- Scan MyProject
12:54:10.217 INFO - Language is forced to php
12:54:10.238 INFO - Load server rules
12:54:11.104 INFO - Load server rules (done) | time=866ms
12:54:11.233 INFO - Base dir: /projectpath/workspace
12:54:11.233 INFO - Working dir: /projectpath/.sonar
12:54:11.235 INFO - Source paths: app
12:54:11.235 INFO - Source encoding: UTF-8, default locale: en_US
12:54:11.236 INFO - Index files
12:54:11.265 INFO - Excluded sources:
12:54:11.266 INFO - app/Vendor/**
12:54:11.266 INFO - app/Plugin/**/Test/**
12:54:11.266 INFO - app/Test/**
12:54:11.266 INFO - app/Test/**
12:54:11.266 INFO - Included tests:
12:54:11.266 INFO - app/Test/**
12:54:16.551 INFO - 983 files indexed
12:54:16.552 INFO - 12296 files ignored because of inclusion/exclusion patterns
12:54:16.661 INFO - Quality profile for php: Sonar way
12:54:17.180 INFO - JaCoCoSensor: JaCoCo report not found : /projectpath/target/jacoco.exec
12:54:17.183 INFO - JaCoCoItSensor: JaCoCo IT report not found: /projectpath/target/jacoco-it.exec
12:54:17.220 INFO - Sensor NoSonar and Commented out LOC Sensor
12:54:17.926 INFO - Sensor NoSonar and Commented out LOC Sensor (done) | time=706ms
12:54:17.926 INFO - Sensor Lines Sensor
12:54:18.161 INFO - Sensor Lines Sensor (done) | time=235ms
12:54:18.162 INFO - Sensor PHPSensor
12:54:18.894 INFO - 509 source files to be analyzed
12:54:28.909 INFO - 265/509 files analyzed, current file: /projectpath/MyFile.php
12:54:38.479 INFO - Sensor PHPSensor (done) | time=20317ms
12:54:38.479 INFO - Sensor PHPUnit Sensor
12:54:38.479 INFO - 509/509 source files have been analyzed
12:54:38.480 INFO - PHPUnit xml test report not found: app/junit-output.xml
12:54:38.480 INFO - PHPUnit xml unit test coverage report not found: app/clover-coverage.xml
12:54:38.480 INFO - No PHPUnit integration test coverage report provided (see 'sonar.php.coverage.itReportPath' property)
12:54:38.480 INFO - No PHPUnit overall coverage report provided (see 'sonar.php.coverage.overallReportPath' property)
12:54:38.480 INFO - Sensor PHPUnit Sensor (done) | time=1ms
12:54:38.480 INFO - Load server issues
12:54:40.752 INFO - Load server issues (done) | time=2272ms
12:54:40.753 INFO - Performing issue tracking
12:54:43.215 INFO - 1210/1210 components tracked
12:54:43.216 INFO - ANALYSIS SUCCESSFUL
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
Total time: 45.188s
Final Memory: 7M/215M
INFO: ------------------------------------------------------------------------
Does anyone have any idea why this upgrade has stopped the SonarQube scanner from commenting/analyzing our pull request?
Duh, we forgot to install the github plugin on our new SonarQube instance...
The command output should include:
Starting analysis of pull request:
https://github.com/Organization/OurRepository/pull/2940
If it doesn't, you're most likely missing the github plugin.

SonarQube 5.2 - Issues not locked against custom Java rules

Using SonarQube 5.2 with Sonar-Java-Plugin 3.8, and for analysis Sonar-Runner 2.4 is used.
Plugin and java-custom examples are downloaded from git (https://github.com/SonarSource/sonar-examples/tree/master/plugins/java-custom-rules), built and deployed on server, and rules are visible on the server. Rules were activated using web under "Sonar Way" profile (which is default). A new test profile is also created and rule "Avoid Brand in method name" is added to it, and associated a project to it.
While analyzing sample java code from (/src/test/files), issues from all default java rules are locked on server, but no issue for the custom rules are locked. There are no explicit error in logs either.
sonar-runner.properties
sonar.host.url=http://localhost:9000
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar52?useUnicode=true&characterEncoding=utf8
sonar.jdbc.username=root
sonar.jdbc.password=ChangeIt
sonar.projectKey=TestSonarCustomRules
sonar.projectName=TestSonarCustomRules
sonar.projectVersion=1.0
sonar.sources=E:/Sonar Example/sonar-examples-master/plugins/java-custom-rules/src/test/files/
Here are the analysis logs:
E:\sonar-runner-2.4
SonarQube Runner 2.4
Java 1.8.0_45 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
INFO: Runner configuration file: E:\sonar-runner-2.4\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Work directory: E:\Sonar Example\sonar-examples-master\plugins\java-custom-rules\src\test\files\.\.sonar
INFO: SonarQube Server 5.2
18:56:49.391 INFO - Load global repositories
18:56:49.539 INFO - Load global repositories (done) | time=145ms
18:56:49.557 WARN - Property 'sonar.jdbc.url' is not supported any more. There is no more DB connection to the SQ database. It will be ignored.
18:56:49.558 WARN - Property 'sonar.jdbc.username' is not supported any more. There is no more DB connection to the SQ database. It will be ignored.
18:56:49.558 WARN - Property 'sonar.jdbc.password' is not supported any more. There is no more DB connection to the SQ database. It will be ignored.
18:56:49.560 INFO - User cache: C:\Users\kapil.saxena\.sonar\cache
18:56:49.777 INFO - Load plugins index
18:56:49.781 INFO - Load plugins index (done) | time=4ms
18:56:49.960 INFO - Process project properties
18:56:50.209 INFO - Load project repositories
18:56:50.290 INFO - Load project repositories (done) | time=81ms
18:56:50.298 INFO - Apply project exclusions
18:56:50.369 INFO - Load quality profiles
18:56:50.401 INFO - Load quality profiles (done) | time=32ms
18:56:50.403 INFO - Load active rules
18:56:50.478 INFO - Load active rules (done) | time=75ms
18:56:50.498 WARN - SCM provider autodetection failed. No SCM provider claims to support this project. Please use sonar.scm.provider to define SCM of your project.
18:56:50.499 INFO - Publish mode
18:56:50.500 INFO - ------------- Scan TestSonarCustomRules
18:56:50.582 INFO - Load server rules
18:56:50.630 INFO - Load server rules (done) | time=48ms
18:56:50.683 INFO - Base dir: E:\Sonar Example\sonar-examples-master\plugins\java-custom-rules\src\test\files
18:56:50.683 INFO - Working dir: E:\Sonar Example\sonar-examples-master\plugins\java-custom-rules\src\test\files\.sonar
18:56:50.685 INFO - Source paths: .
18:56:50.685 INFO - Source encoding: windows-1252, default locale: en_US
18:56:50.686 INFO - Index files
18:56:50.758 INFO - 7 files indexed
18:56:50.760 INFO - Quality profile for java: Kapil Test Profile
18:56:50.786 INFO - Sensor JavaSquidSensor
18:56:50.925 INFO - Configured Java source version: none
18:56:50.954 INFO - JavaClasspath initialization...
18:56:50.954 INFO - JavaClasspath initialization done: 0 ms
18:56:50.954 INFO - JavaTestClasspath initialization...
18:56:50.954 INFO - JavaTestClasspath initialization done: 0 ms
18:56:51.232 INFO - Java Main Files AST scan...
18:56:51.234 INFO - 7 source files to be analyzed
18:56:51.631 INFO - 7/7 source files have been analyzed
18:56:51.632 INFO - Java Main Files AST scan done: 400 ms
18:56:51.632 WARN - Java bytecode has not been made available to the analyzer. The org.sonar.java.bytecode.visitor.DependenciesVisitor#3a5c2626 are disabled.
18:56:51.632 INFO - Java Test Files AST scan...
18:56:51.632 INFO - 0 source files to be analyzed
18:56:51.632 INFO - Java Test Files AST scan done: 0 ms
18:56:51.632 INFO - 0/0 source files have been analyzed
18:56:51.632 INFO - Sensor JavaSquidSensor (done) | time=846ms
18:56:51.633 INFO - Sensor Lines Sensor
18:56:51.635 INFO - Sensor Lines Sensor (done) | time=2ms
18:56:51.635 INFO - Sensor QProfileSensor
18:56:51.640 INFO - Sensor QProfileSensor (done) | time=5ms
18:56:51.640 INFO - Sensor SurefireSensor
18:56:51.641 INFO - parsing E:\Sonar Example\sonar-examples-master\plugins\java-custom-rules\src\test\files\target\surefire-reports
18:56:51.641 ERROR - Reports path not found or is not a directory: E:\Sonar Example\sonar-examples-master\plugins\java-custom-rules\src\test\files\target\surefire-reports
18:56:51.641 INFO - Sensor SurefireSensor (done) | time=1ms
18:56:51.641 INFO - Sensor SCM Sensor
18:56:51.641 INFO - No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
18:56:51.641 INFO - Sensor SCM Sensor (done) | time=0ms
18:56:51.641 INFO - Sensor Code Colorizer Sensor
18:56:51.642 INFO - Sensor Code Colorizer Sensor (done) | time=1ms
18:56:51.642 INFO - Sensor CPD Sensor
18:56:51.642 INFO - JavaCpdEngine is used for java
18:56:51.682 INFO - Sensor CPD Sensor (done) | time=40ms
18:56:51.752 INFO - Analysis reports generated in 68ms, dir size=9 KB
18:56:51.873 INFO - Analysis reports compressed in 121ms, zip size=11 KB
18:56:51.912 INFO - Analysis reports sent to server in 38ms
18:56:51.913 INFO - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/TestSonarCustomRules
18:56:51.913 INFO - Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report.
18:56:51.913 INFO - More about the report processing at http://localhost:9000/api/ce/task?id=AVGl0nT8XJ_fdu5L48WL
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS INFO:
------------------------------------------------------------------------
Total time: 3.290s Final Memory: 14M/325M INFO:
------------------------------------------------------------------------
sonar, access and wrapper logs are all clean.
Here's image from SonarQube web showing issues for AvoidBrandInMethodNamesChecks, where all default issues are locked but issues against custom rule are not locked:
Issues for AvoidBrandInMethodNamesCheck
Any help would be appreciated.
Debug statements from custom plugin code were not executed when analysis was done with logging level at verbose/DEBUG.
The behaviour was the same when analysis was done using SonarQube 5.1 / 5.2 / 5.3 against databases default embedded H2 / PostgreSQL 9.5
Finally worked. I was using wrong version of examples. My pom.xml file of java-custom-rules did not have the following:
<dependency>
<groupId>org.sonarsource.java</groupId>
<artifactId>java-squid</artifactId>
<version>${java.plugin.version}</version>
</dependency>
Note: Get the latest version of examples.

0 files indexed after migrating from sonarqube 5.0.1 to 5.1.2

After migrating our project from sonarqube 5.0.1 to 5.1.2 we get no results after analysing. I gues its because sonar runner is indexing 0 files....The configuration, like basedir, didnt change. Does anyone having an idea?
Build step 'Invoke Gradle script' changed build result to SUCCESS
[workspace] $ C:\Users\Jenkins\.jenkins\tools\hudson.plugins.sonar.SonarRunnerInstallation\SonarRunner\bin\sonar-runner.bat -e -Dsonar.jdbc.url=jdbc:postgresql://localhost/sonar ******** ******** -Dsonar.host.url=http://zaphod:9000/ ******** ******** -Dsonar.projectBaseDir=C:\Users\Jenkins\.jenkins\jobs\KISSsoftCRM_develop\workspace -Dsonar.sources=src/api,src/main -Dsonar.junit.reportsPath=build/test-results -Dsonar.jacoco.reportPath=build/jacoco/test.exec -Dsonar.jacoco.reportMissing.force.zero=true -Dsonar.projectVersion=1.0.0 -Dsonar.java.binaries=build/classes -Dsonar.modules=CRMUtil -Dsonar.projectKey=com.kisssoft.crm.util -Dsonar.java.libraries=build/libs -Dsonar.java.coveragePlugin=jacoco -Dsonar.projectName=CRMUtil_develop
C:\Users\Jenkins\.jenkins\tools\hudson.plugins.sonar.SonarRunnerInstallation\SonarRunner
SonarQube Runner 2.4
Java 1.8.0_25 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\Users\Jenkins\.jenkins\tools\hudson.plugins.sonar.SonarRunnerInstallation\SonarRunner\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "de_DE", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Work directory: C:\Users\Jenkins\.jenkins\jobs\KISSsoftCRM_develop\workspace\.sonar
INFO: SonarQube Server 5.1.2
14:35:00.881 INFO - Load global repositories
14:35:01.213 INFO - Load global repositories (done) | time=334ms
14:35:01.215 INFO - Server id: 20150802141341
14:35:01.218 INFO - User cache: C:\Users\Jenkins\.sonar\cache
14:35:01.228 INFO - Install plugins
14:35:01.283 INFO - Install JDBC driver
14:35:01.293 INFO - Create JDBC datasource for jdbc:postgresql://localhost/sonar
14:35:04.103 INFO - Initializing Hibernate
14:35:06.921 INFO - Load project repositories
14:35:07.002 INFO - Load project repositories (done) | time=81ms
14:35:07.002 INFO - Load project settings
14:35:08.261 INFO - Load technical debt model
14:35:08.287 INFO - Apply project exclusions
14:35:08.975 INFO - ------------- Scan CRMUtil
14:35:08.981 INFO - Load module settings
14:35:09.162 INFO - Load rules
14:35:09.230 INFO - Base dir: C:\Users\Jenkins\.jenkins\jobs\KISSsoftCRM_develop\workspace\CRMUtil
14:35:09.230 INFO - Working dir: C:\Users\Jenkins\.jenkins\jobs\KISSsoftCRM_develop\workspace\.sonar\com.kisssoft.crm.util_CRMUtil
14:35:09.231 INFO - Source paths: src/api, src/main
14:35:09.232 INFO - Source encoding: windows-1252, default locale: de_DE
14:35:09.232 INFO - Index files
14:35:09.265 INFO - 0 files indexed
14:35:09.751 INFO - Sensor Lines Sensor
14:35:09.753 INFO - Sensor Lines Sensor (done) | time=2ms
14:35:09.753 INFO - Sensor QProfileSensor
14:35:09.770 INFO - Sensor QProfileSensor (done) | time=17ms
14:35:09.770 INFO - Sensor InitialOpenIssuesSensor
14:35:09.791 INFO - Sensor InitialOpenIssuesSensor (done) | time=21ms
14:35:09.791 INFO - Sensor ProjectLinksSensor
14:35:09.801 INFO - Sensor ProjectLinksSensor (done) | time=10ms
14:35:09.801 INFO - Sensor VersionEventsSensor
14:35:10.115 INFO - Sensor VersionEventsSensor (done) | time=314ms
14:35:10.115 INFO - Sensor SCM Sensor
14:35:10.115 INFO - SCM Sensor is disabled
14:35:10.115 INFO - Sensor SCM Sensor (done) | time=0ms
14:35:10.115 INFO - Sensor CPD Sensor
14:35:10.115 INFO - Sensor CPD Sensor (done) | time=0ms
14:35:10.147 INFO - Loaded quality gate 'SonarQube way'
14:35:10.204 INFO - Compare to previous analysis (2015-08-02)
14:35:10.212 INFO - Compare over 30 days (2015-07-03, analysis of Tue Jun 30 23:09:17 CEST 2015)
14:35:10.215 INFO - Compare to previous version (2015-07-28)
14:35:11.237 INFO - Execute decorators...
14:35:11.745 INFO - ------------- Scan CRMUtil_develop
14:35:11.746 INFO - Load module settings
14:35:11.772 INFO - Base dir: C:\Users\Jenkins\.jenkins\jobs\KISSsoftCRM_develop\workspace
14:35:11.772 INFO - Working dir: C:\Users\Jenkins\.jenkins\jobs\KISSsoftCRM_develop\workspace\.sonar
14:35:11.772 INFO - Source encoding: windows-1252, default locale: de_DE
14:35:11.776 INFO - Sensor Lines Sensor
14:35:11.776 INFO - Sensor Lines Sensor (done) | time=0ms
14:35:11.776 INFO - Sensor InitialOpenIssuesSensor
14:35:11.782 INFO - Sensor InitialOpenIssuesSensor (done) | time=6ms
14:35:11.783 INFO - Sensor ProjectLinksSensor
14:35:11.786 INFO - Sensor ProjectLinksSensor (done) | time=2ms
14:35:11.786 INFO - Sensor VersionEventsSensor
14:35:11.793 INFO - Sensor VersionEventsSensor (done) | time=7ms
14:35:11.793 INFO - Sensor SCM Sensor
14:35:11.793 INFO - SCM Sensor is disabled
14:35:11.793 INFO - Sensor SCM Sensor (done) | time=0ms
14:35:11.793 INFO - Sensor CPD Sensor
14:35:11.793 INFO - Sensor CPD Sensor (done) | time=0ms
14:35:11.819 INFO - Loaded quality gate 'SonarQube way'
14:35:11.823 INFO - Compare to previous analysis (2015-08-02)
14:35:11.825 INFO - Compare over 30 days (2015-07-03, analysis of Tue Jun 30 23:09:17 CEST 2015)
14:35:11.827 INFO - Compare to previous version (2015-07-28)
14:35:13.311 INFO - Execute decorators...
14:35:13.527 INFO - Store results in database
14:35:13.792 INFO - Analysis reports generated in 41ms, dir size=169 bytes
14:35:13.815 INFO - Analysis reports compressed in 22ms, zip size=777 bytes
14:35:13.853 INFO - Analysis reports sent to server in 38ms
14:35:13.853 INFO - ANALYSIS SUCCESSFUL, you can browse http://zaphod:9000/dashboard/index/com.kisssoft.crm.util
14:35:13.853 INFO - Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report.
You probably forget to copy extensions/plugins from the old install to the new one. As a result you don't have any language plugin installed. Please provide server startup logs to confirm.
Yes we are building it against Java 8 on Jenkins.
This is the configuration:
sonar.projectKey=com.kisssoft.crm.util
sonar.projectName=CRMUtil_develop
sonar.projectVersion=1.0.0
sonar.sources=src/api,src/main
# sonar.tests=src/test
sonar.modules=CRMUtil
sonar.junit.reportsPath=build/test-results
sonar.jacoco.reportPath=build/jacoco/test.exec
sonar.jacoco.reportMissing.force.zero=true
sonar.java.coveragePlugin=jacoco
sonar.java.binaries=build/classes
sonar.java.libraries=build/libs
When i have a look at the base dir it seems correct in my opinion
it seems that SonarQube is missing the needed plugins. I have faced the same issue, but after installing them through settings->Update Center everything worked fine.
please check the same with your configuration and install all required plugins within Sonarqube.

Resources