You should always use the Maven/Gradle/Ant scanner for Java analysis (assuming you are using one of those build technologies) as it makes configuration much easier and access to corresponding binaries and dependent libraries is required. Using the CLI scanner, you’ll need to configure a lot of parameters that are already known as part of the Maven/Gradle/Ant build.
Note that you must use the Scanner for MSBuild if you are analyzing .NET projects.
The only reason I am leaning more towards CLI scanner is due to in our repositories we have multi-language code. If I use the SonarScanner for maven, that wouldn’t scan the other programming language files. Is that Correct?
Instead If I use the CLI Scanner that would scan the whole source code files once the repo is checked out during Jenkins Build job.
Do you have any other recommendation for our use case?