Indeed, it looks like you’re running the SonarScanner CLI, which isn’t the recommended way (unless your normal build tool is an ant, in which case it’s the only way).
This is because the SonarScanner CLI requires a lot of manual configuration to perform an accurate analysis of Java, specifically the bytecode (the “semantic” I was referring to earlier)
I’m not sure what build tool is underneath your make commands are hiding. Can you tell me more about how your Java code is compiled?
Yes, we are using ant as the build tool, but don’t really understand how the build tool impacts the sonar analysis since the source and byte code generated are not really dependent on the build tool that is utilized. Java is still responsible for generating the byte code and not the build tool.
Yes, but how that bytecode makes its way to the scanner to help analysis is build-tool dependent (and for Maven and Gradle, we can pick up those paths automatically).
We have documented a migration path from the SonarScanner for Ant to the SonarScanner CLI. You weren’t ever using the SonarScanner for Ant, but the general advice (add sonar.java.* to a sonar-project.properties file) still applies.
Once the proper bytecode is being read into your analysis, these FPs on S1854 should go away.