Search code examples
c++jenkinssonarqubejenkins-pipelinesonarqube-scan

SonarQube error during the analysis - missing property. but what property should i set?


I am trying to get sonarqube analysis don on my project. I keep getting this error . the error says there is a missing property. the code is c++ and i have also added the test path and also source directory path in the properties file. but i am not sure what property it is refering to. please guide !!!

14:10:11.010 INFO: 1072 files indexed
14:10:11.010 INFO: 1718 files ignored because of inclusion/exclusion patterns
   14:10:11.079 INFO: Quality profile for cpp: CleanSweep
   14:10:11.436 DEBUG: Code colorizer, supported languages: 
   14:10:12.852 DEBUG: 'C' skipped because there is no related file in current project
   14:10:12.853 DEBUG: 'Objective-C' skipped because there is no related file in current project
   14:10:12.853 DEBUG: 'gcov' skipped because one of the required properties is missing
   14:10:12.853 DEBUG: 'llvm-cov' skipped because one of the required properties is missing
    14:10:12.853 DEBUG: 'cppunit' skipped because one of the required properties is missing
    14:10:12.854 DEBUG: 'VisualStudioCoverage' skipped because one of the required properties is missing
   14:10:12.854 DEBUG: 'bullseye' skipped because one of the required properties is missing
    14:10:12.854 DEBUG: 'FxCop (cs)' skipped because there is no related file in current project
    14:10:12.855 DEBUG: 'FxCop (vbnet)' skipped because there is no related file in current project
   14:10:12.856 DEBUG: 'JavaScript Squid Sensor' skipped because there is no related file in current project
   14:10:12.856 DEBUG: 'C#' skipped because there is no related file in current project
    14:10:12.857 DEBUG: 'C# Unit Tests Coverage Report Import' skipped because there is no related file in current project
    14:10:12.858 DEBUG: 'C# Integration Tests Coverage Report Import' skipped because there is no related file in current project
 14:10:12.858 DEBUG: 'C# Unit Test Results Import' skipped because there is no related file in current project
  14:10:12.859 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
  14:10:12.860 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
   14:10:12.860 DEBUG: 'JaCoCoItSensor' skipped because there is no related file in current project
   14:10:12.861 DEBUG: 'JaCoCoOverallSensor' skipped because there is no related file in current project
  14:10:12.861 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
14:10:12.862 DEBUG: 'Linting sensor for TypeScript files' skipped because there is no related file in current project
 14:10:12.863 DEBUG: 'Combined LCOV and LOC sensor' skipped because there is no related file in current project
  14:10:12.869 DEBUG: Sensors : Lines Sensor (wrapped) -> com.stevpet.sonar.plugins.dotnet.mscover.failfast.FailFastSensor@370c9018 -> SCM Sensor (wrapped) -> C++ (wrapped) -> SonarJavaXmlFileSensor (wrapped) -> Zero Coverage Sensor (wrapped) -> Code Colorizer Sensor (wrapped) -> CPD Block Indexer (wrapped)
  14:10:12.894 INFO: devcockpit licensed to Software, PRODUCTION [Expiration: 2018-03-27, Server: 170e60000c88925]
  14:10:12.921 INFO: cpp licensed to Software, PRODUCTION [Expiration: 2018-09-27, Server: 170e60000c88925]
 14:10:12.926 INFO: Sensor Lines Sensor (wrapped)
 14:10:13.111 INFO: Sensor Lines Sensor (wrapped) (done) | time=185ms
  14:10:13.111 INFO: Sensor com.stevpet.sonar.plugins.dotnet.mscover.failfast.FailFastSensor
    14:10:13.117 INFO: ------------------------------------------------------------------------
  14:10:13.117 INFO: EXECUTION FAILURE
  14:10:13.117 INFO: ------------------------------------------------------------------------
   14:10:13.118 INFO: Total time: 13.853s
   14:10:13.258 INFO: Final Memory: 53M/313M
   14:10:13.258 INFO: ------------------------------------------------------------------------
   14:10:13.258 ERROR: Error during SonarQube Scanner execution
                                                                                         com.stevpet.sonar.plugins.dotnet.mscover.property.InvalidPropertyValueException:      Missing property
sonar.mscover.integrationtests.dir
 property is required, and parent must exist
    at  com.stevpet.sonar.plugins.dotnet.mscover.property.CoverageRootProperty.onGetValue(CoverageRootProperty.java:51)
    at    com.stevpet.sonar.plugins.dotnet.mscover.property.CoverageRootProperty.onGetValue(CoverageRootProperty.java:29)
    at com.stevpet.sonar.plugins.dotnet.mscover.property.ConfigurationPropertyBase.getValue(ConfigurationPropertyBase.java:49)
    at  com.stevpet.sonar.plugins.dotnet.mscover.property.ConfigurationPropertyBase.validate(ConfigurationPropertyBase.java:55)
     at com.stevpet.sonar.plugins.dotnet.mscover.DefaultIntegrationTestsConfiguration.validate(DefaultIntegrationTestsConfiguration.java:121)
    at com.stevpet.sonar.plugins.dotnet.mscover.failfast.FailFastSensor.analyse(FailFastSensor.java:55)
   at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
   at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
    at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
       at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
     at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
     at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
      at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
      at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
     at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
     at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
       at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
      at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
         at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke  (DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:498)
     at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
     at com.sun.proxy.$Proxy0.execute(Unknown Source)
     at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
    at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis  (EmbeddedScanner.java:151)
     at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
     at org.sonarsource.scanner.cli.Main.main(Main.java:61)
     14:10:13.262 DEBUG: Execution getVersion
    14:10:13.263 DEBUG: Execution stop
   [Pipeline] }
   [Pipeline] // withSonarQubeEnv
   [Pipeline] }
   [Pipeline] // stage
   [Pipeline] echo
   project build error: hudson.AbortException: script returned exit code 1
   [Pipeline] step

My sonar properties file is

    # must be unique in a given SonarQube instance
    sonar.projectKey=server
    # this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
    sonar.projectName=server
    sonar.projectVersion=1.0

     # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
     # This property is optional if sonar.modules is set. 
    sonar.sources=.

    # language
    sonar.language=cpp

   # path to test source directories

    sonar.test.inclusions=**/UnitTest/**

    sonar.test.reportPath=**/test_result.xml


    # Encoding of the source code. Default is default system encoding
    sonar.sourceEncoding=UTF-8

Solution

  • The log says:

    Missing property sonar.mscover.integrationtests.dir property is required, and parent must exist

    This property is used by the sonar-mscover plugin.

    It should points to the directory which stores integration tests.

    You can probably disable this plugin by add a line sonar.mscover.integrationtests.mode= to the sonar.properties file.