When trying to upload an object-C/Swift project, the sonar scanner returns error with
Line 2 of report refers to a file with an unknown language:
ERROR: Error during SonarQube Scanner execution
Error during parsing of the generic coverage report ‘/mnt/jenkins/workspace/Client_Libs/Fusion/test/build/sonarqube-generic-coverage.xml’. Look at SonarQube documentation to know the expected XML format.
Caused by: java.lang.IllegalStateException: Line 2 of report refers to a file with an unknown language: /mnt/jenkins/workspace/Client_Libs/Fusion/test/ThreeDSSDK/ThreeDSSDK/ios-sdk-core/Models/VCData/SelectButton/NT3DSSelectButtonData.m
Execute sonar-scanner with Jenkins worker which is running CentOS7
So it is not possible to run the build wrapper with the current setup
The log showing this:
18:19:21.243 ERROR: Error during SonarQube Scanner execution
java.lang.UnsupportedOperationException:
The only way to get an accurate analysis of C/C++/Objective-C files is by using the SonarSource build-wrapper
and setting the property “sonar.cfamily.build-wrapper-output”, but it was not specified.
If you don’t want to analyze C/C++/Objective-C files, then prevent them from being analyzed by setting the following properties:
You can’t use SonarQube to only display coverage. There has to be an analysis of the underlying source code as well. In order to make this work, you’re going to need to build with the build wrapper and feed that into analysis.