Sonar scanner giving error while project execution

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    sonar server 7.9, sonar scanner 4.1, Ubuntu 1804
  • what are you trying to achieve
    i am trying to execute a java project from CLI with sonar scanner
  • what have you tried so far to achieve this
    i have edited sonar scanner property file and then executed below command.


i have found below error for the execution of project with sonar.

sonar failure logs

root@ip-172-31-38-231:/opt/sonar_scanner# sonar-scanner-

INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution Please provide compiled classes of your project with property
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(
at org.sonar.core.platform.ComponentContainer.startComponents(
at org.sonar.core.platform.ComponentContainer.execute(
at org.sonar.scanner.scan.ProjectScanContainer.scan(
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(
at org.sonar.core.platform.ComponentContainer.startComponents(
at org.sonar.core.platform.ComponentContainer.execute(
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(
at org.sonar.core.platform.ComponentContainer.startComponents(
at org.sonar.core.platform.ComponentContainer.execute(
at org.sonar.batch.bootstrapper.Batch.doExecute(
at org.sonar.batch.bootstrapper.Batch.execute(
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
at org.sonarsource.scanner.api.EmbeddedScanner.execute(
at org.sonarsource.scanner.cli.Main.execute(
at org.sonarsource.scanner.cli.Main.execute(
at org.sonarsource.scanner.cli.Main.main(
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

plz help , it is urgent.


In former versions the property has been optional but it’s obligatory for some time now. So you need to set this property for the analysis of Java projects.

see for all details

Compiled .class files are required for java projects with more than one java file. If not provided properly, analysis will fail with the message:

Your project contains .java files, please provide compiled classes with property, or exclude them from the analysis with sonar.exclusions property.


1 Like

Hi Gilbert,
So property should be defined inside sonar-scanner conf property file settings right ?

Can you give me the example to declare & its value ?


no, is a property for the SonarJava code analyzer -
not for the Sonar scanner itself.
The $installdir/conf/ has only the

You wrote it’s a java project, so i guess you’re using a build tool like Maven, Gradle or Ant !?
If you provide more details, e.g. which buildtool, does it run within Jenkins pipeline … etc. i may
give you specific hints.

Hi Gilbert ,

I am facing this issue and can provide you with my ant script please ?

Welcome :slight_smile:

hijacking older threads is not recommended :wink:
Also the subject line “Sonar scanner giving error while project execution” is too general.
If you get the error message about the missing property, then this
is missing in your ant script before calling the sonarqube ant task:

<property name="" value="xxx" />

For all details about running the analysis with ant see

If any further questions please open a new thread and i’m happy to help.



Thank you for your fast reply.

I have created a new new thread which you can find here :