Local/ vs Integration Tool differences in scanning

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube: 9.5

  • what are you trying to achieve
    Scanning locally, the scanner works perfectly. However, when trying to integrate with CircleCI, the CLI reports an error saying that sonar.java.binaries is an invalid file path/directory.

  • what have you tried so far to achieve this
    I know it’s not a syntax error because the syntax stayed the same from local → CircleCI. I’ve tried persisting my workspace within my CircleCI configurations, but CircleCI does not pick up on that directory whatsoever. I’ve also cross referenced a project that works within CircleCI with the exact same configurations (aside from the libararies/binaries for Java within sonar-project.properties).

Hey there.

If you are analyzing Java, you should really be using the SonarScanner for Maven, Gradle, or Ant (depending on the build tool you use). This will automatically populate the parameters correctly, and ensure a fresh build happened prior to the analysis.