Excluding C/C++ analysis

SonarScanner: 4.0.0.1744, SonarQube: 8.3.1

I want to exclude analysis of C/C++ code in a Java project. I added the following settings to sonar-project.properties

sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=- 
sonar.objc.file.suffixes=-

I still see this error

18:02:26.437 INFO: ------------------------------------------------------------------------
18:02:26.437 INFO: EXECUTION FAILURE
18:02:26.437 INFO: ------------------------------------------------------------------------
18:02:26.437 INFO: Total time: 9.159s
18:02:26.646 INFO: Final Memory: 48M/1589M
18:02:26.646 INFO: ------------------------------------------------------------------------
18:02:26.646 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:

    sonar.c.file.suffixes=-
    sonar.cpp.file.suffixes=-
    sonar.objc.file.suffixes=-


	at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:138)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)

Am I missing something?

Thanks

Hi,

What you tried seems eminently reasonable & I’m not sure off-hand about the order of operations that caused it to not work. I think what you want to do instead is either set an exclusion (which ought to work) or perhaps define sonar.sources more narrowly (which would definitely work). The docs should help.

 
Ann