Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-12 Thread David Karr
You would have to look at what directory you're running the scan from, what
your "sonar.sources" property is set to, and what your project structure
looks like.

Getting correct coverage data is certainly important, but you won't be able
to get coverage data if you haven't found any source files.

On Thu, Nov 12, 2020 at 6:47 AM jesus fernandez <
jesusfernandez0...@gmail.com> wrote:

> I have noticed that as well, my question is why is not indexing any
> files... I do not find why, I have tried with the sonar-project.properties
> in the root folder and adding the arguments with -D, I have tried in 3
> different projects and I always get the same result.
>
> El jueves, 12 de noviembre de 2020 a las 11:58:07 UTC+1,
> geoffroy...@gmail.com escribió:
>
>> I would have a look here:
>> 00:00:03.846  11:26:43.035 INFO: Indexing files...
>> 00:00:03.846  11:26:43.035 INFO: Project configuration:
>> 00:00:03.846  11:26:43.039 INFO: 0 files indexed
>>
>> Seems it is not finding any file to analyse...
>>
>>
>> On Thu, 12 Nov 2020 at 11:47, Richard Bywater  wrote:
>>
>>> I think you've been chasing the wrong issue. The lack of a project root
>>> configuration file is normal if everything is configured elsewhere. As far
>>> as I can tell you are having issues with no code coverage?
>>>
>>> >00:10:46.807  INFO: Sensor JaCoCo XML Report Importer [jacoco]
>>> >00:10:46.807  INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not
>>> defined. Using default locations:
>>> target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
>>> >00:10:46.807  INFO: No report imported, no coverage information will be
>>> imported by JaCoCo XML Report Importer
>>>
>>> This is probably what you should be looking at - ensuring that your
>>> build is output a jacocoTestRepo.xml into the right location. Note that
>>> older versions of Sonarqube used to use the Jacoco binary file but newer
>>> versions require you to have generated the XML output.
>>>
>>> Richard.
>>>
>>> On Thu, 12 Nov 2020 at 23:28, jesus fernandez 
>>> wrote:
>>>
 This is the huge log I get with -X parameter:



 00:00:00.913  Injecting SonarQube environment variables using the
 configuration: SonarQube2
 [Pipeline] {
 [Pipeline] bat
 00:00:01.203
 00:00:01.203
 C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
 -X -Dsonar.projectKey=Test -Dsonar.projectName=Test -Dsonar.sources=.
 -Dsonar.scm.disabled=true -Dsonar.language=c++ -Dsonar.sourceEncoding=UTF-8
 00:00:01.203  11:26:40.422 INFO: Scanner configuration file:
 C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
 00:00:01.203  11:26:40.426 INFO: Project root configuration file: NONE
 00:00:01.203  11:26:40.438 INFO: SonarScanner 4.4.0.2170
 00:00:01.203  11:26:40.438 INFO: Java 1.8.0_261 Oracle Corporation
 (64-bit)
 00:00:01.203  11:26:40.438 INFO: Windows 10 10.0 amd64
 00:00:01.467  11:26:40.533 DEBUG: keyStore is :
 00:00:01.467  11:26:40.533 DEBUG: keyStore type is : jks
 00:00:01.467  11:26:40.533 DEBUG: keyStore provider is :
 00:00:01.467  11:26:40.533 DEBUG: init keystore
 00:00:01.467  11:26:40.533 DEBUG: init keymanager of type SunX509
 00:00:02.044  11:26:41.044 DEBUG: Create:
 C:\WINDOWS\system32\config\systemprofile\.sonar\cache
 00:00:02.044  11:26:41.045 INFO: User cache:
 C:\WINDOWS\system32\config\systemprofile\.sonar\cache
 00:00:02.044  11:26:41.045 DEBUG: Create:
 C:\WINDOWS\system32\config\systemprofile\.sonar\cache\_tmp
 00:00:02.044  11:26:41.047 DEBUG: Extract sonar-scanner-api-batch in
 temp...
 00:00:02.044  11:26:41.051 DEBUG: Get bootstrap index...
 00:00:02.044  11:26:41.051 DEBUG: Download:
 http://localhost:9000/batch/index
 00:00:02.044  11:26:41.083 DEBUG: Get bootstrap completed
 00:00:02.044  11:26:41.088 DEBUG: Create isolated classloader...
 00:00:02.044  11:26:41.094 DEBUG: Start temp cleaning...
 00:00:02.044  11:26:41.098 DEBUG: Temp cleaning done
 00:00:02.044  11:26:41.098 INFO: Scanner configuration file:
 C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
 00:00:02.044  11:26:41.099 INFO: Project root configuration file: NONE
 00:00:02.044  11:26:41.099 DEBUG: Execution getVersion
 00:00:02.044  11:26:41.101 INFO: Analyzing on SonarQube server 8.5.1
 00:00:02.044  11:26:41.102 INFO: Default locale: "es_ES", source code
 encoding: "UTF-8"
 00:00:02.044  11:26:41.102 DEBUG: Work directory:
 C:\Users\anton\.jenkins\workspace\Boston\.scannerwork
 00:00:02.044  11:26:41.103 DEBUG: Execution execute

Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-12 Thread Geoffroy J
I would have a look here:
00:00:03.846  11:26:43.035 INFO: Indexing files...
00:00:03.846  11:26:43.035 INFO: Project configuration:
00:00:03.846  11:26:43.039 INFO: 0 files indexed

Seems it is not finding any file to analyse...


On Thu, 12 Nov 2020 at 11:47, Richard Bywater  wrote:

> I think you've been chasing the wrong issue. The lack of a project root
> configuration file is normal if everything is configured elsewhere. As far
> as I can tell you are having issues with no code coverage?
>
> >00:10:46.807  INFO: Sensor JaCoCo XML Report Importer [jacoco]
> >00:10:46.807  INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not
> defined. Using default locations:
> target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
> >00:10:46.807  INFO: No report imported, no coverage information will be
> imported by JaCoCo XML Report Importer
>
> This is probably what you should be looking at - ensuring that your build
> is output a jacocoTestRepo.xml into the right location. Note that older
> versions of Sonarqube used to use the Jacoco binary file but newer versions
> require you to have generated the XML output.
>
> Richard.
>
> On Thu, 12 Nov 2020 at 23:28, jesus fernandez <
> jesusfernandez0...@gmail.com> wrote:
>
>> This is the huge log I get with -X parameter:
>>
>>
>>
>> 00:00:00.913  Injecting SonarQube environment variables using the
>> configuration: SonarQube2
>> [Pipeline] {
>> [Pipeline] bat
>> 00:00:01.203
>> 00:00:01.203
>> C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
>> -X -Dsonar.projectKey=Test -Dsonar.projectName=Test -Dsonar.sources=.
>> -Dsonar.scm.disabled=true -Dsonar.language=c++ -Dsonar.sourceEncoding=UTF-8
>> 00:00:01.203  11:26:40.422 INFO: Scanner configuration file:
>> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
>> 00:00:01.203  11:26:40.426 INFO: Project root configuration file: NONE
>> 00:00:01.203  11:26:40.438 INFO: SonarScanner 4.4.0.2170
>> 00:00:01.203  11:26:40.438 INFO: Java 1.8.0_261 Oracle Corporation
>> (64-bit)
>> 00:00:01.203  11:26:40.438 INFO: Windows 10 10.0 amd64
>> 00:00:01.467  11:26:40.533 DEBUG: keyStore is :
>> 00:00:01.467  11:26:40.533 DEBUG: keyStore type is : jks
>> 00:00:01.467  11:26:40.533 DEBUG: keyStore provider is :
>> 00:00:01.467  11:26:40.533 DEBUG: init keystore
>> 00:00:01.467  11:26:40.533 DEBUG: init keymanager of type SunX509
>> 00:00:02.044  11:26:41.044 DEBUG: Create:
>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
>> 00:00:02.044  11:26:41.045 INFO: User cache:
>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
>> 00:00:02.044  11:26:41.045 DEBUG: Create:
>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache\_tmp
>> 00:00:02.044  11:26:41.047 DEBUG: Extract sonar-scanner-api-batch in
>> temp...
>> 00:00:02.044  11:26:41.051 DEBUG: Get bootstrap index...
>> 00:00:02.044  11:26:41.051 DEBUG: Download:
>> http://localhost:9000/batch/index
>> 00:00:02.044  11:26:41.083 DEBUG: Get bootstrap completed
>> 00:00:02.044  11:26:41.088 DEBUG: Create isolated classloader...
>> 00:00:02.044  11:26:41.094 DEBUG: Start temp cleaning...
>> 00:00:02.044  11:26:41.098 DEBUG: Temp cleaning done
>> 00:00:02.044  11:26:41.098 INFO: Scanner configuration file:
>> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
>> 00:00:02.044  11:26:41.099 INFO: Project root configuration file: NONE
>> 00:00:02.044  11:26:41.099 DEBUG: Execution getVersion
>> 00:00:02.044  11:26:41.101 INFO: Analyzing on SonarQube server 8.5.1
>> 00:00:02.044  11:26:41.102 INFO: Default locale: "es_ES", source code
>> encoding: "UTF-8"
>> 00:00:02.044  11:26:41.102 DEBUG: Work directory:
>> C:\Users\anton\.jenkins\workspace\Boston\.scannerwork
>> 00:00:02.044  11:26:41.103 DEBUG: Execution execute
>> 00:00:02.309  11:26:41.416 WARN: SonarScanner will require Java 11 to run
>> starting in SonarQube 8.x
>> 00:00:02.309  11:26:41.417 DEBUG: Community 8.5.1.38104
>> 00:00:02.309  11:26:41.483 INFO: Load global settings
>> 00:00:02.309  11:26:41.507 DEBUG: GET 200
>> http://localhost:9000/api/settings/values.protobuf | time=22ms
>> 00:00:02.309  11:26:41.523 INFO: Load global settings (done) | time=40ms
>> 00:00:02.309  11:26:41.524 INFO: Server id: BF41A1F2-AXWnoupqHjnRwWgEnmvK
>> 00:00:02.309  11:26:41.526 INFO: User cache:
>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
>> 00:00:02.309  11:26:41.528 INFO: Load/download plugins
>> 00:00:02.309  11:26:41.529 INFO: Load plugins index
>> 00:00:02.309  11:26:41.535 DEBUG: GET 200
>> http://localhost:9000/api/plugins/installed | time=6ms
>> 00:00:02.309  11:26:41.555 INFO: Load plugins index (done) | time=26ms
>> 

Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-12 Thread Richard Bywater
I think you've been chasing the wrong issue. The lack of a project root
configuration file is normal if everything is configured elsewhere. As far
as I can tell you are having issues with no code coverage?

>00:10:46.807  INFO: Sensor JaCoCo XML Report Importer [jacoco]
>00:10:46.807  INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined.
Using default locations:
target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
>00:10:46.807  INFO: No report imported, no coverage information will be
imported by JaCoCo XML Report Importer

This is probably what you should be looking at - ensuring that your build
is output a jacocoTestRepo.xml into the right location. Note that older
versions of Sonarqube used to use the Jacoco binary file but newer versions
require you to have generated the XML output.

Richard.

On Thu, 12 Nov 2020 at 23:28, jesus fernandez 
wrote:

> This is the huge log I get with -X parameter:
>
>
>
> 00:00:00.913  Injecting SonarQube environment variables using the
> configuration: SonarQube2
> [Pipeline] {
> [Pipeline] bat
> 00:00:01.203
> 00:00:01.203
> C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
> -X -Dsonar.projectKey=Test -Dsonar.projectName=Test -Dsonar.sources=.
> -Dsonar.scm.disabled=true -Dsonar.language=c++ -Dsonar.sourceEncoding=UTF-8
> 00:00:01.203  11:26:40.422 INFO: Scanner configuration file:
> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
> 00:00:01.203  11:26:40.426 INFO: Project root configuration file: NONE
> 00:00:01.203  11:26:40.438 INFO: SonarScanner 4.4.0.2170
> 00:00:01.203  11:26:40.438 INFO: Java 1.8.0_261 Oracle Corporation (64-bit)
> 00:00:01.203  11:26:40.438 INFO: Windows 10 10.0 amd64
> 00:00:01.467  11:26:40.533 DEBUG: keyStore is :
> 00:00:01.467  11:26:40.533 DEBUG: keyStore type is : jks
> 00:00:01.467  11:26:40.533 DEBUG: keyStore provider is :
> 00:00:01.467  11:26:40.533 DEBUG: init keystore
> 00:00:01.467  11:26:40.533 DEBUG: init keymanager of type SunX509
> 00:00:02.044  11:26:41.044 DEBUG: Create:
> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
> 00:00:02.044  11:26:41.045 INFO: User cache:
> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
> 00:00:02.044  11:26:41.045 DEBUG: Create:
> C:\WINDOWS\system32\config\systemprofile\.sonar\cache\_tmp
> 00:00:02.044  11:26:41.047 DEBUG: Extract sonar-scanner-api-batch in
> temp...
> 00:00:02.044  11:26:41.051 DEBUG: Get bootstrap index...
> 00:00:02.044  11:26:41.051 DEBUG: Download:
> http://localhost:9000/batch/index
> 00:00:02.044  11:26:41.083 DEBUG: Get bootstrap completed
> 00:00:02.044  11:26:41.088 DEBUG: Create isolated classloader...
> 00:00:02.044  11:26:41.094 DEBUG: Start temp cleaning...
> 00:00:02.044  11:26:41.098 DEBUG: Temp cleaning done
> 00:00:02.044  11:26:41.098 INFO: Scanner configuration file:
> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
> 00:00:02.044  11:26:41.099 INFO: Project root configuration file: NONE
> 00:00:02.044  11:26:41.099 DEBUG: Execution getVersion
> 00:00:02.044  11:26:41.101 INFO: Analyzing on SonarQube server 8.5.1
> 00:00:02.044  11:26:41.102 INFO: Default locale: "es_ES", source code
> encoding: "UTF-8"
> 00:00:02.044  11:26:41.102 DEBUG: Work directory:
> C:\Users\anton\.jenkins\workspace\Boston\.scannerwork
> 00:00:02.044  11:26:41.103 DEBUG: Execution execute
> 00:00:02.309  11:26:41.416 WARN: SonarScanner will require Java 11 to run
> starting in SonarQube 8.x
> 00:00:02.309  11:26:41.417 DEBUG: Community 8.5.1.38104
> 00:00:02.309  11:26:41.483 INFO: Load global settings
> 00:00:02.309  11:26:41.507 DEBUG: GET 200
> http://localhost:9000/api/settings/values.protobuf | time=22ms
> 00:00:02.309  11:26:41.523 INFO: Load global settings (done) | time=40ms
> 00:00:02.309  11:26:41.524 INFO: Server id: BF41A1F2-AXWnoupqHjnRwWgEnmvK
> 00:00:02.309  11:26:41.526 INFO: User cache:
> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
> 00:00:02.309  11:26:41.528 INFO: Load/download plugins
> 00:00:02.309  11:26:41.529 INFO: Load plugins index
> 00:00:02.309  11:26:41.535 DEBUG: GET 200
> http://localhost:9000/api/plugins/installed | time=6ms
> 00:00:02.309  11:26:41.555 INFO: Load plugins index (done) | time=26ms
> 00:00:02.309  11:26:41.580 INFO: Load/download plugins (done) | time=52ms
> 00:00:02.575  11:26:41.622 DEBUG: Plugins:
> 00:00:02.575  11:26:41.622 DEBUG:   * C++ (Community) 1.3.2.1853 (cxx)
> 00:00:02.575  11:26:41.622 DEBUG:   * Python Code Quality and Security
> 3.1.0.7619 (python)
> 00:00:02.575  11:26:41.622 DEBUG:   * CSS Code Quality and Security
> 1.3.1.1642 (cssfamily)
> 00:00:02.575  11:26:41.622 DEBUG:   * JaCoCo 

Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-12 Thread jesus fernandez
This is the huge log I get with -X parameter:



00:00:00.913  Injecting SonarQube environment variables using the 
configuration: SonarQube2
[Pipeline] {
[Pipeline] bat
00:00:01.203  
00:00:01.203  
C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
 
-X -Dsonar.projectKey=Test -Dsonar.projectName=Test -Dsonar.sources=. 
-Dsonar.scm.disabled=true -Dsonar.language=c++ -Dsonar.sourceEncoding=UTF-8 
00:00:01.203  11:26:40.422 INFO: Scanner configuration file: 
C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
00:00:01.203  11:26:40.426 INFO: Project root configuration file: NONE
00:00:01.203  11:26:40.438 INFO: SonarScanner 4.4.0.2170
00:00:01.203  11:26:40.438 INFO: Java 1.8.0_261 Oracle Corporation (64-bit)
00:00:01.203  11:26:40.438 INFO: Windows 10 10.0 amd64
00:00:01.467  11:26:40.533 DEBUG: keyStore is : 
00:00:01.467  11:26:40.533 DEBUG: keyStore type is : jks
00:00:01.467  11:26:40.533 DEBUG: keyStore provider is : 
00:00:01.467  11:26:40.533 DEBUG: init keystore
00:00:01.467  11:26:40.533 DEBUG: init keymanager of type SunX509
00:00:02.044  11:26:41.044 DEBUG: Create: 
C:\WINDOWS\system32\config\systemprofile\.sonar\cache
00:00:02.044  11:26:41.045 INFO: User cache: 
C:\WINDOWS\system32\config\systemprofile\.sonar\cache
00:00:02.044  11:26:41.045 DEBUG: Create: 
C:\WINDOWS\system32\config\systemprofile\.sonar\cache\_tmp
00:00:02.044  11:26:41.047 DEBUG: Extract sonar-scanner-api-batch in temp...
00:00:02.044  11:26:41.051 DEBUG: Get bootstrap index...
00:00:02.044  11:26:41.051 DEBUG: Download: 
http://localhost:9000/batch/index
00:00:02.044  11:26:41.083 DEBUG: Get bootstrap completed
00:00:02.044  11:26:41.088 DEBUG: Create isolated classloader...
00:00:02.044  11:26:41.094 DEBUG: Start temp cleaning...
00:00:02.044  11:26:41.098 DEBUG: Temp cleaning done
00:00:02.044  11:26:41.098 INFO: Scanner configuration file: 
C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
00:00:02.044  11:26:41.099 INFO: Project root configuration file: NONE
00:00:02.044  11:26:41.099 DEBUG: Execution getVersion
00:00:02.044  11:26:41.101 INFO: Analyzing on SonarQube server 8.5.1
00:00:02.044  11:26:41.102 INFO: Default locale: "es_ES", source code 
encoding: "UTF-8"
00:00:02.044  11:26:41.102 DEBUG: Work directory: 
C:\Users\anton\.jenkins\workspace\Boston\.scannerwork
00:00:02.044  11:26:41.103 DEBUG: Execution execute
00:00:02.309  11:26:41.416 WARN: SonarScanner will require Java 11 to run 
starting in SonarQube 8.x
00:00:02.309  11:26:41.417 DEBUG: Community 8.5.1.38104
00:00:02.309  11:26:41.483 INFO: Load global settings
00:00:02.309  11:26:41.507 DEBUG: GET 200 
http://localhost:9000/api/settings/values.protobuf | time=22ms
00:00:02.309  11:26:41.523 INFO: Load global settings (done) | time=40ms
00:00:02.309  11:26:41.524 INFO: Server id: BF41A1F2-AXWnoupqHjnRwWgEnmvK
00:00:02.309  11:26:41.526 INFO: User cache: 
C:\WINDOWS\system32\config\systemprofile\.sonar\cache
00:00:02.309  11:26:41.528 INFO: Load/download plugins
00:00:02.309  11:26:41.529 INFO: Load plugins index
00:00:02.309  11:26:41.535 DEBUG: GET 200 
http://localhost:9000/api/plugins/installed | time=6ms
00:00:02.309  11:26:41.555 INFO: Load plugins index (done) | time=26ms
00:00:02.309  11:26:41.580 INFO: Load/download plugins (done) | time=52ms
00:00:02.575  11:26:41.622 DEBUG: Plugins:
00:00:02.575  11:26:41.622 DEBUG:   * C++ (Community) 1.3.2.1853 (cxx)
00:00:02.575  11:26:41.622 DEBUG:   * Python Code Quality and Security 
3.1.0.7619 (python)
00:00:02.575  11:26:41.622 DEBUG:   * CSS Code Quality and Security 
1.3.1.1642 (cssfamily)
00:00:02.575  11:26:41.622 DEBUG:   * JaCoCo 1.1.0.898 (jacoco)
00:00:02.575  11:26:41.622 DEBUG:   * SonarGo 1.6.0.719 (go)
00:00:02.575  11:26:41.622 DEBUG:   * SonarKotlin 1.5.0.315 (kotlin)
00:00:02.575  11:26:41.622 DEBUG:   * JavaScript/TypeScript Code Quality 
and Security 6.5.0.13383 (javascript)
00:00:02.575  11:26:41.622 DEBUG:   * SonarRuby 1.5.0.315 (ruby)
00:00:02.575  11:26:41.622 DEBUG:   * SonarScala 1.5.0.315 (sonarscala)
00:00:02.575  11:26:41.623 DEBUG:   * C# Code Quality and Security 
8.13.1.21947 (csharp)
00:00:02.575  11:26:41.623 DEBUG:   * Java Code Quality and Security 
6.8.0.23379 (java)
00:00:02.575  11:26:41.623 DEBUG:   * SonarHTML 3.2.0.2082 (web)
00:00:02.575  11:26:41.623 DEBUG:   * SonarFlex 2.5.1.1831 (flex)
00:00:02.575  11:26:41.623 DEBUG:   * SonarXML 2.0.1.2020 (xml)
00:00:02.575  11:26:41.623 DEBUG:   * PHP Code Quality and Security 
3.9.0.6331 (php)
00:00:02.575  11:26:41.623 DEBUG:   * VB.NET Code Quality and Security 
8.13.1.21947 (vbnet)
00:00:02.838  11:26:41.937 INFO: Process project properties
00:00:02.838  11:26:41.943 INFO: 

Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-12 Thread jesus fernandez
Thanks both for answering, David I have tried both with "-D" with and 
without spaces. Geoffroy I was running a 8++ version I just downloaded 7.9 
but still the same. One question which might be silly (I had used 
SonarQuebe ever before) does the pipeline needs to pull from a SCM for 
sonarqube to test the code? I understood it is not necessary at the moment 
I am just building a c++ project in local and then running the sonarqube 
step. Is that correct?  

El jueves, 12 de noviembre de 2020 a las 9:51:20 UTC+1, 
geoffroy...@gmail.com escribió:

> Hello
>
> i would recommend to remove extra-spaces for "-D" options, this is 
> incorrect syntax, and also enable debug mode (-X).
>
> As you are providing information using the scanner option, maybe it is 
> normal to see "Project root configuration file: NONE " log. Maybe setting 
> sonar.projectBaseDir option could help...
>
> Also, sonar-cxx plugin (if this is the one you are trying to use) is not 
> compatible with SonarQube 8.X: 
> https://github.com/SonarOpenCommunity/sonar-cxx/wiki/SonarQube-compatibility-matrix
>
> Regards
>
> On Thu, 12 Nov 2020 at 01:00, David Karr  wrote:
>
>> I have never seen the "-D" command-line option used with a space between 
>> the option and the provided value, and the documentation never shows that 
>> example.
>>
>> On Wed, Nov 11, 2020 at 1:13 PM jesus fernandez  
>> wrote:
>>
>>> and this is the log:
>>> ```
>>> *00:00:00.901* Injecting SonarQube environment variables using the 
>>> configuration: SonarQube2 [Pipeline] { 
>>>  [Pipeline] bat 
>>>  
>>> *00:00:01.175* *00:00:01.175* 
>>> C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
>>>  
>>> -D sonar.projectKey=Test -D sonar.projectName=Test -D sonar.sources=. -D 
>>> sonar.scm.disabled=true -D sonar.language=c++ -D sonar.sourceEncoding=UTF-8 
>>>  *00:00:01.175* INFO: Scanner configuration file: 
>>> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
>>> *00:00:01.175* INFO: Project root configuration file: NONE 
>>> *00:00:01.175* INFO: SonarScanner 4.4.0.2170 
>>> *00:00:01.175* INFO: Java 1.8.0_261 Oracle Corporation (64-bit) 
>>> *00:00:01.175* INFO: Windows 10 10.0 amd64 
>>> *00:00:02.090* INFO: User cache: 
>>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache 
>>> *00:00:02.090* INFO: Scanner configuration file: 
>>> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
>>>  
>>> *00:00:02.090* INFO: Project root configuration file: NONE 
>>> *00:00:02.090* INFO: Analyzing on SonarQube server 8.5.1 
>>> *00:00:02.090* INFO: Default locale: "es_ES", source code encoding: 
>>> "UTF-8" 
>>> *00:00:02.343* WARN: SonarScanner will require Java 11 to run starting 
>>> in SonarQube 8.x *00:00:02.343* INFO: Load global settings 
>>> *00:00:02.343* INFO: Load global settings (done) | time=42ms 
>>> *00:00:02.343* INFO: Server id: BF41A1F2-AXWnoupqHjnRwWgEnmvK 
>>> *00:00:02.343* INFO: User cache: 
>>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache 
>>> *00:00:02.343* INFO: Load/download plugins 
>>> *00:00:02.343* INFO: Load plugins index 
>>> *00:00:02.343* INFO: Load plugins index (done) | time=26ms 
>>> *00:00:02.594* INFO: Load/download plugins (done) | time=50ms 
>>> *00:00:02.846* INFO: Process project properties 
>>> *00:00:02.846* INFO: Process project properties (done) | time=7ms 
>>> *00:00:02.846* INFO: Execute project builders 
>>> *00:00:02.846* INFO: Execute project builders (done) | time=1ms 
>>> *00:00:02.846* INFO: Project key: Test 
>>> *00:00:02.846* INFO: Base dir: C:\Users\anton\.jenkins\workspace\Boston 
>>> *00:00:02.846* INFO: Working dir: 
>>> C:\Users\anton\.jenkins\workspace\Boston\.scannerwork 
>>> *00:00:03.097* INFO: Load project settings for component key: 'Test' 
>>> *00:00:03.097* INFO: Load project settings for component key: 'Test' 
>>> (done) | time=9ms
>>> *00:00:03.097* INFO: Load quality profiles 
>>> *00:00:03.097* INFO: Load quality profiles (done) | time=38ms 
>>> *00:00:03.097* INFO: Auto-configuring with CI 'Jenkins' 
>>> *00:00:03.097* INFO: Load active rules 
>>> *00:00:04.011* INFO: Load active rules (done) | time=981ms 
>>> *00:00:04.263* INFO: Indexing files... 
>>> *00:00:04.263* INFO: Project configuration: 
>>> *00:00:04.263* INFO: 0 files indexed 
>>> *00:00:04.263* INFO: - Run sensors on module Test 
>>> *00:00:04.263* INFO: Load metrics repository 
>>> *00:00:04.263* INFO: Load metrics repository (done) | time=13ms 
>>> *00:00:05.178* INFO: Sensor CSS Rules [cssfamily] 
>>> *00:00:05.178* INFO: No CSS, PHP, HTML or VueJS files are found in the 
>>> project. CSS 

Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-12 Thread Jesus Fernandez
Thanks both for answering, David I have tried both with "-D" with and 
without spaces. Geoffroy I was running a 8++ version I just downloaded 7.9 
but still the same. One question which might be silly (I had used 
SonarQuebe ever before) does the pipeline needs to pull from a SCM for 
sonarqube to test the code? I understood it is not necessary at the moment 
I am just building a c++ project in local and then running the sonarqube 
step. Is that correct?

On Thursday, November 12, 2020 at 9:51:20 AM UTC+1 geoffroy...@gmail.com 
wrote:

> Hello
>
> i would recommend to remove extra-spaces for "-D" options, this is 
> incorrect syntax, and also enable debug mode (-X).
>
> As you are providing information using the scanner option, maybe it is 
> normal to see "Project root configuration file: NONE " log. Maybe setting 
> sonar.projectBaseDir option could help...
>
> Also, sonar-cxx plugin (if this is the one you are trying to use) is not 
> compatible with SonarQube 8.X: 
> https://github.com/SonarOpenCommunity/sonar-cxx/wiki/SonarQube-compatibility-matrix
>
> Regards
>
> On Thu, 12 Nov 2020 at 01:00, David Karr  wrote:
>
>> I have never seen the "-D" command-line option used with a space between 
>> the option and the provided value, and the documentation never shows that 
>> example.
>>
>> On Wed, Nov 11, 2020 at 1:13 PM jesus fernandez  
>> wrote:
>>
>>> and this is the log:
>>> ```
>>> *00:00:00.901* Injecting SonarQube environment variables using the 
>>> configuration: SonarQube2 [Pipeline] { 
>>>  [Pipeline] bat 
>>>  
>>> *00:00:01.175* *00:00:01.175* 
>>> C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
>>>  
>>> -D sonar.projectKey=Test -D sonar.projectName=Test -D sonar.sources=. -D 
>>> sonar.scm.disabled=true -D sonar.language=c++ -D sonar.sourceEncoding=UTF-8 
>>>  *00:00:01.175* INFO: Scanner configuration file: 
>>> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
>>> *00:00:01.175* INFO: Project root configuration file: NONE 
>>> *00:00:01.175* INFO: SonarScanner 4.4.0.2170 
>>> *00:00:01.175* INFO: Java 1.8.0_261 Oracle Corporation (64-bit) 
>>> *00:00:01.175* INFO: Windows 10 10.0 amd64 
>>> *00:00:02.090* INFO: User cache: 
>>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache 
>>> *00:00:02.090* INFO: Scanner configuration file: 
>>> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
>>>  
>>> *00:00:02.090* INFO: Project root configuration file: NONE 
>>> *00:00:02.090* INFO: Analyzing on SonarQube server 8.5.1 
>>> *00:00:02.090* INFO: Default locale: "es_ES", source code encoding: 
>>> "UTF-8" 
>>> *00:00:02.343* WARN: SonarScanner will require Java 11 to run starting 
>>> in SonarQube 8.x *00:00:02.343* INFO: Load global settings 
>>> *00:00:02.343* INFO: Load global settings (done) | time=42ms 
>>> *00:00:02.343* INFO: Server id: BF41A1F2-AXWnoupqHjnRwWgEnmvK 
>>> *00:00:02.343* INFO: User cache: 
>>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache 
>>> *00:00:02.343* INFO: Load/download plugins 
>>> *00:00:02.343* INFO: Load plugins index 
>>> *00:00:02.343* INFO: Load plugins index (done) | time=26ms 
>>> *00:00:02.594* INFO: Load/download plugins (done) | time=50ms 
>>> *00:00:02.846* INFO: Process project properties 
>>> *00:00:02.846* INFO: Process project properties (done) | time=7ms 
>>> *00:00:02.846* INFO: Execute project builders 
>>> *00:00:02.846* INFO: Execute project builders (done) | time=1ms 
>>> *00:00:02.846* INFO: Project key: Test 
>>> *00:00:02.846* INFO: Base dir: C:\Users\anton\.jenkins\workspace\Boston 
>>> *00:00:02.846* INFO: Working dir: 
>>> C:\Users\anton\.jenkins\workspace\Boston\.scannerwork 
>>> *00:00:03.097* INFO: Load project settings for component key: 'Test' 
>>> *00:00:03.097* INFO: Load project settings for component key: 'Test' 
>>> (done) | time=9ms
>>> *00:00:03.097* INFO: Load quality profiles 
>>> *00:00:03.097* INFO: Load quality profiles (done) | time=38ms 
>>> *00:00:03.097* INFO: Auto-configuring with CI 'Jenkins' 
>>> *00:00:03.097* INFO: Load active rules 
>>> *00:00:04.011* INFO: Load active rules (done) | time=981ms 
>>> *00:00:04.263* INFO: Indexing files... 
>>> *00:00:04.263* INFO: Project configuration: 
>>> *00:00:04.263* INFO: 0 files indexed 
>>> *00:00:04.263* INFO: - Run sensors on module Test 
>>> *00:00:04.263* INFO: Load metrics repository 
>>> *00:00:04.263* INFO: Load metrics repository (done) | time=13ms 
>>> *00:00:05.178* INFO: Sensor CSS Rules [cssfamily] 
>>> *00:00:05.178* INFO: No CSS, PHP, HTML or VueJS files are found in the 
>>> project. CSS analysis is 

Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-12 Thread Geoffroy J
Hello

i would recommend to remove extra-spaces for "-D" options, this is
incorrect syntax, and also enable debug mode (-X).

As you are providing information using the scanner option, maybe it is
normal to see "Project root configuration file: NONE " log. Maybe setting
sonar.projectBaseDir option could help...

Also, sonar-cxx plugin (if this is the one you are trying to use) is not
compatible with SonarQube 8.X:
https://github.com/SonarOpenCommunity/sonar-cxx/wiki/SonarQube-compatibility-matrix

Regards

On Thu, 12 Nov 2020 at 01:00, David Karr  wrote:

> I have never seen the "-D" command-line option used with a space between
> the option and the provided value, and the documentation never shows that
> example.
>
> On Wed, Nov 11, 2020 at 1:13 PM jesus fernandez <
> jesusfernandez0...@gmail.com> wrote:
>
>> and this is the log:
>> ```
>> *00:00:00.901* Injecting SonarQube environment variables using the
>> configuration: SonarQube2 [Pipeline] {
>>  [Pipeline] bat
>> 
>> *00:00:01.175* *00:00:01.175*
>> C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
>> -D sonar.projectKey=Test -D sonar.projectName=Test -D sonar.sources=. -D
>> sonar.scm.disabled=true -D sonar.language=c++ -D sonar.sourceEncoding=UTF-8
>>  *00:00:01.175* INFO: Scanner configuration file:
>> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
>> *00:00:01.175* INFO: Project root configuration file: NONE
>> *00:00:01.175* INFO: SonarScanner 4.4.0.2170
>> *00:00:01.175* INFO: Java 1.8.0_261 Oracle Corporation (64-bit)
>> *00:00:01.175* INFO: Windows 10 10.0 amd64
>> *00:00:02.090* INFO: User cache:
>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
>> *00:00:02.090* INFO: Scanner configuration file:
>> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
>> *00:00:02.090* INFO: Project root configuration file: NONE
>> *00:00:02.090* INFO: Analyzing on SonarQube server 8.5.1
>> *00:00:02.090* INFO: Default locale: "es_ES", source code encoding:
>> "UTF-8"
>> *00:00:02.343* WARN: SonarScanner will require Java 11 to run starting
>> in SonarQube 8.x *00:00:02.343* INFO: Load global settings
>> *00:00:02.343* INFO: Load global settings (done) | time=42ms
>> *00:00:02.343* INFO: Server id: BF41A1F2-AXWnoupqHjnRwWgEnmvK
>> *00:00:02.343* INFO: User cache:
>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
>> *00:00:02.343* INFO: Load/download plugins
>> *00:00:02.343* INFO: Load plugins index
>> *00:00:02.343* INFO: Load plugins index (done) | time=26ms
>> *00:00:02.594* INFO: Load/download plugins (done) | time=50ms
>> *00:00:02.846* INFO: Process project properties
>> *00:00:02.846* INFO: Process project properties (done) | time=7ms
>> *00:00:02.846* INFO: Execute project builders
>> *00:00:02.846* INFO: Execute project builders (done) | time=1ms
>> *00:00:02.846* INFO: Project key: Test
>> *00:00:02.846* INFO: Base dir: C:\Users\anton\.jenkins\workspace\Boston
>> *00:00:02.846* INFO: Working dir:
>> C:\Users\anton\.jenkins\workspace\Boston\.scannerwork
>> *00:00:03.097* INFO: Load project settings for component key: 'Test'
>> *00:00:03.097* INFO: Load project settings for component key: 'Test'
>> (done) | time=9ms
>> *00:00:03.097* INFO: Load quality profiles
>> *00:00:03.097* INFO: Load quality profiles (done) | time=38ms
>> *00:00:03.097* INFO: Auto-configuring with CI 'Jenkins'
>> *00:00:03.097* INFO: Load active rules
>> *00:00:04.011* INFO: Load active rules (done) | time=981ms
>> *00:00:04.263* INFO: Indexing files...
>> *00:00:04.263* INFO: Project configuration:
>> *00:00:04.263* INFO: 0 files indexed
>> *00:00:04.263* INFO: - Run sensors on module Test
>> *00:00:04.263* INFO: Load metrics repository
>> *00:00:04.263* INFO: Load metrics repository (done) | time=13ms
>> *00:00:05.178* INFO: Sensor CSS Rules [cssfamily]
>> *00:00:05.178* INFO: No CSS, PHP, HTML or VueJS files are found in the
>> project. CSS analysis is skipped. *00:00:05.178* INFO: Sensor CSS Rules
>> [cssfamily] (done) | time=1ms
>> *00:00:05.178* INFO: Sensor JaCoCo XML Report Importer [jacoco]
>> *00:00:05.178* INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not
>> defined. Using default locations:
>> target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
>> *00:00:05.178* INFO: No report imported, no coverage information will be
>> imported by JaCoCo XML Report Importer *00:00:05.178* INFO: Sensor
>> JaCoCo XML Report Importer [jacoco] (done) | time=3ms
>> *00:00:05.178* INFO: Sensor C# Properties [csharp]
>> *00:00:05.178* INFO: Sensor C# Properties [csharp] 

Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-11 Thread David Karr
I have never seen the "-D" command-line option used with a space between
the option and the provided value, and the documentation never shows that
example.

On Wed, Nov 11, 2020 at 1:13 PM jesus fernandez <
jesusfernandez0...@gmail.com> wrote:

> and this is the log:
> ```
> *00:00:00.901* Injecting SonarQube environment variables using the
> configuration: SonarQube2 [Pipeline] {
>  [Pipeline] bat
> 
> *00:00:01.175* *00:00:01.175*
> C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
> -D sonar.projectKey=Test -D sonar.projectName=Test -D sonar.sources=. -D
> sonar.scm.disabled=true -D sonar.language=c++ -D sonar.sourceEncoding=UTF-8
>  *00:00:01.175* INFO: Scanner configuration file:
> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
> *00:00:01.175* INFO: Project root configuration file: NONE
> *00:00:01.175* INFO: SonarScanner 4.4.0.2170
> *00:00:01.175* INFO: Java 1.8.0_261 Oracle Corporation (64-bit)
> *00:00:01.175* INFO: Windows 10 10.0 amd64
> *00:00:02.090* INFO: User cache:
> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
> *00:00:02.090* INFO: Scanner configuration file:
> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
> *00:00:02.090* INFO: Project root configuration file: NONE
> *00:00:02.090* INFO: Analyzing on SonarQube server 8.5.1
> *00:00:02.090* INFO: Default locale: "es_ES", source code encoding:
> "UTF-8"
> *00:00:02.343* WARN: SonarScanner will require Java 11 to run starting in
> SonarQube 8.x *00:00:02.343* INFO: Load global settings
> *00:00:02.343* INFO: Load global settings (done) | time=42ms
> *00:00:02.343* INFO: Server id: BF41A1F2-AXWnoupqHjnRwWgEnmvK
> *00:00:02.343* INFO: User cache:
> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
> *00:00:02.343* INFO: Load/download plugins
> *00:00:02.343* INFO: Load plugins index
> *00:00:02.343* INFO: Load plugins index (done) | time=26ms
> *00:00:02.594* INFO: Load/download plugins (done) | time=50ms
> *00:00:02.846* INFO: Process project properties
> *00:00:02.846* INFO: Process project properties (done) | time=7ms
> *00:00:02.846* INFO: Execute project builders
> *00:00:02.846* INFO: Execute project builders (done) | time=1ms
> *00:00:02.846* INFO: Project key: Test
> *00:00:02.846* INFO: Base dir: C:\Users\anton\.jenkins\workspace\Boston
> *00:00:02.846* INFO: Working dir:
> C:\Users\anton\.jenkins\workspace\Boston\.scannerwork
> *00:00:03.097* INFO: Load project settings for component key: 'Test'
> *00:00:03.097* INFO: Load project settings for component key: 'Test'
> (done) | time=9ms
> *00:00:03.097* INFO: Load quality profiles
> *00:00:03.097* INFO: Load quality profiles (done) | time=38ms
> *00:00:03.097* INFO: Auto-configuring with CI 'Jenkins'
> *00:00:03.097* INFO: Load active rules
> *00:00:04.011* INFO: Load active rules (done) | time=981ms
> *00:00:04.263* INFO: Indexing files...
> *00:00:04.263* INFO: Project configuration:
> *00:00:04.263* INFO: 0 files indexed
> *00:00:04.263* INFO: - Run sensors on module Test
> *00:00:04.263* INFO: Load metrics repository
> *00:00:04.263* INFO: Load metrics repository (done) | time=13ms
> *00:00:05.178* INFO: Sensor CSS Rules [cssfamily]
> *00:00:05.178* INFO: No CSS, PHP, HTML or VueJS files are found in the
> project. CSS analysis is skipped. *00:00:05.178* INFO: Sensor CSS Rules
> [cssfamily] (done) | time=1ms
> *00:00:05.178* INFO: Sensor JaCoCo XML Report Importer [jacoco]
> *00:00:05.178* INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not
> defined. Using default locations:
> target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
> *00:00:05.178* INFO: No report imported, no coverage information will be
> imported by JaCoCo XML Report Importer *00:00:05.178* INFO: Sensor JaCoCo
> XML Report Importer [jacoco] (done) | time=3ms
> *00:00:05.178* INFO: Sensor C# Properties [csharp]
> *00:00:05.178* INFO: Sensor C# Properties [csharp] (done) | time=2ms
> *00:00:05.178* INFO: Sensor JavaXmlSensor [java]
> *00:00:05.178* INFO: Sensor JavaXmlSensor [java] (done) | time=1ms
> *00:00:05.178* INFO: Sensor VB.NET Properties [vbnet]
> *00:00:05.178* INFO: Sensor VB.NET Properties [vbnet] (done) | time=1ms
> *00:00:05.178* INFO: - Run sensors on project
> *00:00:05.178* INFO: Sensor Zero Coverage Sensor
> *00:00:05.178* INFO: Sensor Zero Coverage Sensor (done) | time=0ms
> *00:00:05.178* INFO: SCM Publisher is disabled
> *00:00:05.178* INFO: CPD Executor Calculating CPD for 0 files
> *00:00:05.178* INFO: CPD Executor CPD calculation finished (done) |
> time=0ms
> 

Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-11 Thread jesus fernandez
and this is the log:
```
*00:00:00.901* Injecting SonarQube environment variables using the 
configuration: SonarQube2 [Pipeline] { 
 [Pipeline] bat 
 
*00:00:01.175* *00:00:01.175* 
C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
 
-D sonar.projectKey=Test -D sonar.projectName=Test -D sonar.sources=. -D 
sonar.scm.disabled=true -D sonar.language=c++ -D sonar.sourceEncoding=UTF-8 
 *00:00:01.175* INFO: Scanner configuration file: 
C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
*00:00:01.175* INFO: Project root configuration file: NONE 
*00:00:01.175* INFO: SonarScanner 4.4.0.2170 
*00:00:01.175* INFO: Java 1.8.0_261 Oracle Corporation (64-bit) 
*00:00:01.175* INFO: Windows 10 10.0 amd64 
*00:00:02.090* INFO: User cache: 
C:\WINDOWS\system32\config\systemprofile\.sonar\cache 
*00:00:02.090* INFO: Scanner configuration file: 
C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
 
*00:00:02.090* INFO: Project root configuration file: NONE 
*00:00:02.090* INFO: Analyzing on SonarQube server 8.5.1 
*00:00:02.090* INFO: Default locale: "es_ES", source code encoding: "UTF-8" 
*00:00:02.343* WARN: SonarScanner will require Java 11 to run starting in 
SonarQube 8.x *00:00:02.343* INFO: Load global settings 
*00:00:02.343* INFO: Load global settings (done) | time=42ms 
*00:00:02.343* INFO: Server id: BF41A1F2-AXWnoupqHjnRwWgEnmvK 
*00:00:02.343* INFO: User cache: 
C:\WINDOWS\system32\config\systemprofile\.sonar\cache 
*00:00:02.343* INFO: Load/download plugins 
*00:00:02.343* INFO: Load plugins index 
*00:00:02.343* INFO: Load plugins index (done) | time=26ms 
*00:00:02.594* INFO: Load/download plugins (done) | time=50ms 
*00:00:02.846* INFO: Process project properties 
*00:00:02.846* INFO: Process project properties (done) | time=7ms 
*00:00:02.846* INFO: Execute project builders 
*00:00:02.846* INFO: Execute project builders (done) | time=1ms 
*00:00:02.846* INFO: Project key: Test 
*00:00:02.846* INFO: Base dir: C:\Users\anton\.jenkins\workspace\Boston 
*00:00:02.846* INFO: Working dir: 
C:\Users\anton\.jenkins\workspace\Boston\.scannerwork 
*00:00:03.097* INFO: Load project settings for component key: 'Test' 
*00:00:03.097* INFO: Load project settings for component key: 'Test' (done) 
| time=9ms
*00:00:03.097* INFO: Load quality profiles 
*00:00:03.097* INFO: Load quality profiles (done) | time=38ms 
*00:00:03.097* INFO: Auto-configuring with CI 'Jenkins' 
*00:00:03.097* INFO: Load active rules 
*00:00:04.011* INFO: Load active rules (done) | time=981ms 
*00:00:04.263* INFO: Indexing files... 
*00:00:04.263* INFO: Project configuration: 
*00:00:04.263* INFO: 0 files indexed 
*00:00:04.263* INFO: - Run sensors on module Test 
*00:00:04.263* INFO: Load metrics repository 
*00:00:04.263* INFO: Load metrics repository (done) | time=13ms 
*00:00:05.178* INFO: Sensor CSS Rules [cssfamily] 
*00:00:05.178* INFO: No CSS, PHP, HTML or VueJS files are found in the 
project. CSS analysis is skipped. *00:00:05.178* INFO: Sensor CSS Rules 
[cssfamily] (done) | time=1ms
*00:00:05.178* INFO: Sensor JaCoCo XML Report Importer [jacoco] 
*00:00:05.178* INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. 
Using default locations: 
target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
 
*00:00:05.178* INFO: No report imported, no coverage information will be 
imported by JaCoCo XML Report Importer *00:00:05.178* INFO: Sensor JaCoCo 
XML Report Importer [jacoco] (done) | time=3ms 
*00:00:05.178* INFO: Sensor C# Properties [csharp] 
*00:00:05.178* INFO: Sensor C# Properties [csharp] (done) | time=2ms 
*00:00:05.178* INFO: Sensor JavaXmlSensor [java] 
*00:00:05.178* INFO: Sensor JavaXmlSensor [java] (done) | time=1ms 
*00:00:05.178* INFO: Sensor VB.NET Properties [vbnet] 
*00:00:05.178* INFO: Sensor VB.NET Properties [vbnet] (done) | time=1ms 
*00:00:05.178* INFO: - Run sensors on project 
*00:00:05.178* INFO: Sensor Zero Coverage Sensor 
*00:00:05.178* INFO: Sensor Zero Coverage Sensor (done) | time=0ms 
*00:00:05.178* INFO: SCM Publisher is disabled 
*00:00:05.178* INFO: CPD Executor Calculating CPD for 0 files 
*00:00:05.178* INFO: CPD Executor CPD calculation finished (done) | 
time=0ms 
*00:00:05.178* INFO: Analysis report generated in 58ms, dir size=82 KB 
*00:00:05.178* INFO: Analysis report compressed in 14ms, zip size=10 KB 
*00:00:05.178* INFO: Analysis report uploaded in 25ms 
*00:00:05.178* INFO: ANALYSIS SUCCESSFUL, you can browse 
http://localhost:9000/dashboard?id=Test *00:00:05.178* INFO: Note that you 

Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-11 Thread jesus fernandez
Thanks Geofrroy for your answer,

I had posted the question in the sonarsource community with no answer 
already. I am using the free version with the C++ plugin which works fine 
in many tutorials and videos you can find online. This is my pipeline:
```
pipeline
{   
agent any

options { timestamps () }
stages{

stage('Build'){
steps{
retry(2){
script {
bat """
"C:\\Program Files (x86)\\Microsoft Visual 
Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\MSBuild.exe" 
"C:\\Users\\anton\\source\\repos\\WindowsProject1\\WindowsProject1.sln"
"""
} 
}
}
}

  stage('SonarQube analysis') {
steps{
script{
def scannerHome = tool 'Sonnar_scanner'
withSonarQubeEnv('SonarQube2') {
bat """

${scannerHome}\\sonar-scanner-4.4.0.2170\\bin\\sonar-scanner.bat -D 
sonar.projectKey=Test -D sonar.projectName=Test -D sonar.sources=. -D 
sonar.scm.disabled=true -D sonar.language=c++ -D sonar.sourceEncoding=UTF-8
"""
}
}
}
}
}
}

```

Thanks!

El miércoles, 11 de noviembre de 2020 a las 20:45:45 UTC+1, 
geoffroy...@gmail.com escribió:

> Hello
> you should probably ask here: https://community.sonarsource.com/ 
> Are you using the paid version of SonarQube, to get C/C++ analysis feature?
> Also, from experience, before running any new tool analysis from Jenkins, 
> it is better to first run (and debug) it locally. Sonar scanner local 
> analysis is quite easy to execute, it could help you troubleshoot your 
> issue.
> Last, please post your pipeline code so we can check you are properly 
> running the analysis from the source folder actually containing the sonar 
> properties file
> Regards
>
> On Wednesday, 11 November 2020 at 17:29:54 UTC+1 jesusfern...@gmail.com 
> wrote:
>
>> Hi David,
>>
>> Thanks for your answer but I get the same result when adding the 
>> parameters with -D I get the "*00:00:01.529* *INFO: Project root 
>> configuration file: NONE"  *message at the beginning of the log. I have 
>> tried to create the helloworld simplest c++ project just to test, but I get 
>> the same error, what am I missing?
>> El martes, 10 de noviembre de 2020 a las 20:41:32 UTC+1, 
>> davidmic...@gmail.com escribió:
>>
>>> I believe that the mistake that most people make with running the 
>>> sonarqube scan from a CI build is TRYING to define a sonarqube properties 
>>> file. It's best to simply provide all of the required options on the 
>>> sonar-scanner command line, using "-D".
>>>
>>> On Tue, Nov 10, 2020 at 3:44 AM jesus fernandez  
>>> wrote:
>>>
 I am trying to learn the basics of sonarqube, I have set it up on my 
 jenkins pipeline (which uses MSBuild to compile the project) and the set a 
 step to execute SonarQube but after reading and watching a few tutorials 
 and the documentation itself I think I got a bit lost as when my pipeline 
 finishes executing I go to my SonarQube server and I my project says 
 ```The 
 main branch has no lines of code.```. I get the following log when running 
 the sonarqube step on my jenkins:
 ```
 00:10:43.369  Injecting SonarQube environment variables using the 
 configuration: SonarQube
 [Pipeline] {
 [Pipeline] bat
 00:10:43.653  
 00:10:43.653  
 C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
   
  
 00:10:43.653  INFO: Scanner configuration file: 
 C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
 00:10:43.653  INFO: Project root configuration file: NONE
 00:10:43.653  INFO: SonarScanner 4.4.0.2170
 00:10:43.653  INFO: Java 1.8.0_261 Oracle Corporation (64-bit)
 00:10:43.653  INFO: Windows 10 10.0 amd64
 00:10:44.230  INFO: User cache: 
 C:\WINDOWS\system32\config\systemprofile\.sonar\cache
 00:10:44.230  INFO: Scanner configuration file: 
 C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
 00:10:44.230  INFO: Project root configuration file: NONE
 00:10:44.230  INFO: Analyzing on SonarQube server 8.5.1
 00:10:44.230  INFO: Default locale: "es_ES", source code encoding: 
 "UTF-8"
 00:10:44.783  WARN: SonarScanner will require Java 11 to run starting 
 in SonarQube 8.x
 00:10:44.784  INFO: Load global settings
 00:10:44.784  INFO: Load global settings (done) | time=40ms
 00:10:44.784  

Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-11 Thread geoffroy...@gmail.com
Hello
you should probably ask here: https://community.sonarsource.com/ 
Are you using the paid version of SonarQube, to get C/C++ analysis feature?
Also, from experience, before running any new tool analysis from Jenkins, 
it is better to first run (and debug) it locally. Sonar scanner local 
analysis is quite easy to execute, it could help you troubleshoot your 
issue.
Last, please post your pipeline code so we can check you are properly 
running the analysis from the source folder actually containing the sonar 
properties file
Regards

On Wednesday, 11 November 2020 at 17:29:54 UTC+1 jesusfern...@gmail.com 
wrote:

> Hi David,
>
> Thanks for your answer but I get the same result when adding the 
> parameters with -D I get the "*00:00:01.529* *INFO: Project root 
> configuration file: NONE"  *message at the beginning of the log. I have 
> tried to create the helloworld simplest c++ project just to test, but I get 
> the same error, what am I missing?
> El martes, 10 de noviembre de 2020 a las 20:41:32 UTC+1, 
> davidmic...@gmail.com escribió:
>
>> I believe that the mistake that most people make with running the 
>> sonarqube scan from a CI build is TRYING to define a sonarqube properties 
>> file. It's best to simply provide all of the required options on the 
>> sonar-scanner command line, using "-D".
>>
>> On Tue, Nov 10, 2020 at 3:44 AM jesus fernandez  
>> wrote:
>>
>>> I am trying to learn the basics of sonarqube, I have set it up on my 
>>> jenkins pipeline (which uses MSBuild to compile the project) and the set a 
>>> step to execute SonarQube but after reading and watching a few tutorials 
>>> and the documentation itself I think I got a bit lost as when my pipeline 
>>> finishes executing I go to my SonarQube server and I my project says ```The 
>>> main branch has no lines of code.```. I get the following log when running 
>>> the sonarqube step on my jenkins:
>>> ```
>>> 00:10:43.369  Injecting SonarQube environment variables using the 
>>> configuration: SonarQube
>>> [Pipeline] {
>>> [Pipeline] bat
>>> 00:10:43.653  
>>> 00:10:43.653  
>>> C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
>>>   
>>>  
>>> 00:10:43.653  INFO: Scanner configuration file: 
>>> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
>>> 00:10:43.653  INFO: Project root configuration file: NONE
>>> 00:10:43.653  INFO: SonarScanner 4.4.0.2170
>>> 00:10:43.653  INFO: Java 1.8.0_261 Oracle Corporation (64-bit)
>>> 00:10:43.653  INFO: Windows 10 10.0 amd64
>>> 00:10:44.230  INFO: User cache: 
>>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
>>> 00:10:44.230  INFO: Scanner configuration file: 
>>> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
>>> 00:10:44.230  INFO: Project root configuration file: NONE
>>> 00:10:44.230  INFO: Analyzing on SonarQube server 8.5.1
>>> 00:10:44.230  INFO: Default locale: "es_ES", source code encoding: 
>>> "UTF-8"
>>> 00:10:44.783  WARN: SonarScanner will require Java 11 to run starting in 
>>> SonarQube 8.x
>>> 00:10:44.784  INFO: Load global settings
>>> 00:10:44.784  INFO: Load global settings (done) | time=40ms
>>> 00:10:44.784  INFO: Server id: BF41A1F2-AXWnoupqHjnRwWgEnmvK
>>> 00:10:44.784  INFO: User cache: 
>>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
>>> 00:10:44.784  INFO: Load/download plugins
>>> 00:10:44.784  INFO: Load plugins index
>>> 00:10:44.784  INFO: Load plugins index (done) | time=26ms
>>> 00:10:44.784  INFO: Load/download plugins (done) | time=48ms
>>> 00:10:45.037  INFO: Process project properties
>>> 00:10:45.037  INFO: Process project properties (done) | time=6ms
>>> 00:10:45.037  INFO: Execute project builders
>>> 00:10:45.037  INFO: Execute project builders (done) | time=1ms
>>> 00:10:45.037  INFO: Project key: Boston
>>> 00:10:45.037  INFO: Base dir: C:\Users\anton\.jenkins\workspace\Boston
>>> 00:10:45.037  INFO: Working dir: 
>>> C:\Users\anton\.jenkins\workspace\Boston\.scannerwork
>>> 00:10:45.301  INFO: Load project settings for component key: 'Boston'
>>> 00:10:45.301  INFO: Load project settings for component key: 'Boston' 
>>> (done) | time=10ms
>>> 00:10:45.301  INFO: Load quality profiles
>>> 00:10:45.301  INFO: Load quality profiles (done) | time=27ms
>>> 00:10:45.301  INFO: Auto-configuring with CI 'Jenkins'
>>> 00:10:45.301  INFO: Load active rules
>>> 00:10:46.241  INFO: Load active rules (done) | time=787ms
>>> 00:10:46.241  INFO: Indexing files...
>>> 00:10:46.241  INFO: Project configuration:
>>> 00:10:46.241  INFO: 0 files indexed
>>> 00:10:46.241  INFO: - Run sensors on module Boston
>>> 00:10:46.241  INFO: Load metrics repository
>>> 00:10:46.241  INFO: Load metrics 

Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-11 Thread jesus fernandez
Hi David,

Thanks for your answer but I get the same result when adding the parameters 
with -D I get the "*00:00:01.529* *INFO: Project root configuration file: 
NONE"  *message at the beginning of the log. I have tried to create the 
helloworld simplest c++ project just to test, but I get the same error, 
what am I missing?
El martes, 10 de noviembre de 2020 a las 20:41:32 UTC+1, 
davidmic...@gmail.com escribió:

> I believe that the mistake that most people make with running the 
> sonarqube scan from a CI build is TRYING to define a sonarqube properties 
> file. It's best to simply provide all of the required options on the 
> sonar-scanner command line, using "-D".
>
> On Tue, Nov 10, 2020 at 3:44 AM jesus fernandez  
> wrote:
>
>> I am trying to learn the basics of sonarqube, I have set it up on my 
>> jenkins pipeline (which uses MSBuild to compile the project) and the set a 
>> step to execute SonarQube but after reading and watching a few tutorials 
>> and the documentation itself I think I got a bit lost as when my pipeline 
>> finishes executing I go to my SonarQube server and I my project says ```The 
>> main branch has no lines of code.```. I get the following log when running 
>> the sonarqube step on my jenkins:
>> ```
>> 00:10:43.369  Injecting SonarQube environment variables using the 
>> configuration: SonarQube
>> [Pipeline] {
>> [Pipeline] bat
>> 00:10:43.653  
>> 00:10:43.653  
>> C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
>>   
>>  
>> 00:10:43.653  INFO: Scanner configuration file: 
>> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
>> 00:10:43.653  INFO: Project root configuration file: NONE
>> 00:10:43.653  INFO: SonarScanner 4.4.0.2170
>> 00:10:43.653  INFO: Java 1.8.0_261 Oracle Corporation (64-bit)
>> 00:10:43.653  INFO: Windows 10 10.0 amd64
>> 00:10:44.230  INFO: User cache: 
>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
>> 00:10:44.230  INFO: Scanner configuration file: 
>> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
>> 00:10:44.230  INFO: Project root configuration file: NONE
>> 00:10:44.230  INFO: Analyzing on SonarQube server 8.5.1
>> 00:10:44.230  INFO: Default locale: "es_ES", source code encoding: "UTF-8"
>> 00:10:44.783  WARN: SonarScanner will require Java 11 to run starting in 
>> SonarQube 8.x
>> 00:10:44.784  INFO: Load global settings
>> 00:10:44.784  INFO: Load global settings (done) | time=40ms
>> 00:10:44.784  INFO: Server id: BF41A1F2-AXWnoupqHjnRwWgEnmvK
>> 00:10:44.784  INFO: User cache: 
>> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
>> 00:10:44.784  INFO: Load/download plugins
>> 00:10:44.784  INFO: Load plugins index
>> 00:10:44.784  INFO: Load plugins index (done) | time=26ms
>> 00:10:44.784  INFO: Load/download plugins (done) | time=48ms
>> 00:10:45.037  INFO: Process project properties
>> 00:10:45.037  INFO: Process project properties (done) | time=6ms
>> 00:10:45.037  INFO: Execute project builders
>> 00:10:45.037  INFO: Execute project builders (done) | time=1ms
>> 00:10:45.037  INFO: Project key: Boston
>> 00:10:45.037  INFO: Base dir: C:\Users\anton\.jenkins\workspace\Boston
>> 00:10:45.037  INFO: Working dir: 
>> C:\Users\anton\.jenkins\workspace\Boston\.scannerwork
>> 00:10:45.301  INFO: Load project settings for component key: 'Boston'
>> 00:10:45.301  INFO: Load project settings for component key: 'Boston' 
>> (done) | time=10ms
>> 00:10:45.301  INFO: Load quality profiles
>> 00:10:45.301  INFO: Load quality profiles (done) | time=27ms
>> 00:10:45.301  INFO: Auto-configuring with CI 'Jenkins'
>> 00:10:45.301  INFO: Load active rules
>> 00:10:46.241  INFO: Load active rules (done) | time=787ms
>> 00:10:46.241  INFO: Indexing files...
>> 00:10:46.241  INFO: Project configuration:
>> 00:10:46.241  INFO: 0 files indexed
>> 00:10:46.241  INFO: - Run sensors on module Boston
>> 00:10:46.241  INFO: Load metrics repository
>> 00:10:46.241  INFO: Load metrics repository (done) | time=12ms
>> 00:10:46.807  INFO: Sensor CSS Rules [cssfamily]
>> 00:10:46.807  INFO: No CSS, PHP, HTML or VueJS files are found in the 
>> project. CSS analysis is skipped.
>> 00:10:46.807  INFO: Sensor CSS Rules [cssfamily] (done) | time=1ms
>> 00:10:46.807  INFO: Sensor JaCoCo XML Report Importer [jacoco]
>> 00:10:46.807  INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not 
>> defined. Using default locations: 
>> target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
>> 00:10:46.807  INFO: No report imported, no coverage information will be 
>> imported by JaCoCo XML Report Importer
>> 00:10:46.807  INFO: Sensor JaCoCo XML Report 

Re: where do I have to set the sonar-project.properties file to make sonar work in Jenkins?

2020-11-10 Thread David Karr
I believe that the mistake that most people make with running the sonarqube
scan from a CI build is TRYING to define a sonarqube properties file. It's
best to simply provide all of the required options on the sonar-scanner
command line, using "-D".

On Tue, Nov 10, 2020 at 3:44 AM jesus fernandez <
jesusfernandez0...@gmail.com> wrote:

> I am trying to learn the basics of sonarqube, I have set it up on my
> jenkins pipeline (which uses MSBuild to compile the project) and the set a
> step to execute SonarQube but after reading and watching a few tutorials
> and the documentation itself I think I got a bit lost as when my pipeline
> finishes executing I go to my SonarQube server and I my project says ```The
> main branch has no lines of code.```. I get the following log when running
> the sonarqube step on my jenkins:
> ```
> 00:10:43.369  Injecting SonarQube environment variables using the
> configuration: SonarQube
> [Pipeline] {
> [Pipeline] bat
> 00:10:43.653
> 00:10:43.653
> C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
>
> 00:10:43.653  INFO: Scanner configuration file:
> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
> 00:10:43.653  INFO: Project root configuration file: NONE
> 00:10:43.653  INFO: SonarScanner 4.4.0.2170
> 00:10:43.653  INFO: Java 1.8.0_261 Oracle Corporation (64-bit)
> 00:10:43.653  INFO: Windows 10 10.0 amd64
> 00:10:44.230  INFO: User cache:
> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
> 00:10:44.230  INFO: Scanner configuration file:
> C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
> 00:10:44.230  INFO: Project root configuration file: NONE
> 00:10:44.230  INFO: Analyzing on SonarQube server 8.5.1
> 00:10:44.230  INFO: Default locale: "es_ES", source code encoding: "UTF-8"
> 00:10:44.783  WARN: SonarScanner will require Java 11 to run starting in
> SonarQube 8.x
> 00:10:44.784  INFO: Load global settings
> 00:10:44.784  INFO: Load global settings (done) | time=40ms
> 00:10:44.784  INFO: Server id: BF41A1F2-AXWnoupqHjnRwWgEnmvK
> 00:10:44.784  INFO: User cache:
> C:\WINDOWS\system32\config\systemprofile\.sonar\cache
> 00:10:44.784  INFO: Load/download plugins
> 00:10:44.784  INFO: Load plugins index
> 00:10:44.784  INFO: Load plugins index (done) | time=26ms
> 00:10:44.784  INFO: Load/download plugins (done) | time=48ms
> 00:10:45.037  INFO: Process project properties
> 00:10:45.037  INFO: Process project properties (done) | time=6ms
> 00:10:45.037  INFO: Execute project builders
> 00:10:45.037  INFO: Execute project builders (done) | time=1ms
> 00:10:45.037  INFO: Project key: Boston
> 00:10:45.037  INFO: Base dir: C:\Users\anton\.jenkins\workspace\Boston
> 00:10:45.037  INFO: Working dir:
> C:\Users\anton\.jenkins\workspace\Boston\.scannerwork
> 00:10:45.301  INFO: Load project settings for component key: 'Boston'
> 00:10:45.301  INFO: Load project settings for component key: 'Boston'
> (done) | time=10ms
> 00:10:45.301  INFO: Load quality profiles
> 00:10:45.301  INFO: Load quality profiles (done) | time=27ms
> 00:10:45.301  INFO: Auto-configuring with CI 'Jenkins'
> 00:10:45.301  INFO: Load active rules
> 00:10:46.241  INFO: Load active rules (done) | time=787ms
> 00:10:46.241  INFO: Indexing files...
> 00:10:46.241  INFO: Project configuration:
> 00:10:46.241  INFO: 0 files indexed
> 00:10:46.241  INFO: - Run sensors on module Boston
> 00:10:46.241  INFO: Load metrics repository
> 00:10:46.241  INFO: Load metrics repository (done) | time=12ms
> 00:10:46.807  INFO: Sensor CSS Rules [cssfamily]
> 00:10:46.807  INFO: No CSS, PHP, HTML or VueJS files are found in the
> project. CSS analysis is skipped.
> 00:10:46.807  INFO: Sensor CSS Rules [cssfamily] (done) | time=1ms
> 00:10:46.807  INFO: Sensor JaCoCo XML Report Importer [jacoco]
> 00:10:46.807  INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined.
> Using default locations:
> target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
> 00:10:46.807  INFO: No report imported, no coverage information will be
> imported by JaCoCo XML Report Importer
> 00:10:46.807  INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) |
> time=1ms
> 00:10:46.807  INFO: Sensor C# Properties [csharp]
> 00:10:46.807  INFO: Sensor C# Properties [csharp] (done) | time=1ms
> 00:10:46.807  INFO: Sensor JavaXmlSensor [java]
> 00:10:46.807  INFO: Sensor JavaXmlSensor [java] (done) | time=0ms
> 00:10:46.807  INFO: Sensor VB.NET Properties [vbnet]
> 00:10:46.807  INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
> 00:10:46.807  INFO: - Run sensors on project
> 00:10:46.807  INFO: Sensor Zero Coverage Sensor