Sonar cloud multi file analysis without build

HI All,

As per our requirement, we need to analyze multiple java files without a build with Sonar Cloud.

The same requirement can be achieved for a single java file using the Command prompt with sonar commands, but is failing for multiple java files as its throwing an error for build required.

The error is as following - "ERROR: Error during SonarScanner execution
org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property."

Can you please tell us a way in which we can analyze multiple java files simultaneously without having a build.

Thanks,
Nishant

A build is required for SonarCloud to perform an analysis of Java code, unless you’re using GitHub + Automatic Analysis, which comes with a number of limitations.

Why can’t you perform build before analyzing the code (or better yet, add analysis to your existing build?).