Search code examples
sonarqubesonar-runner

Is it always safe to define sonar.forceAnalysis=true for SonarQube analysis?


When parallel SonarQube analyses are started, all but one will be rejected / fail with error: The project is already being analysed.

I learned on this mailing list entry that it is possible to override this check by adding --define sonar.forceAnalysis=true to my Apache Maven command.

Thus (to repeat the title): Is it always safe to define sonar.forceAnalysis=true for SonarQube analysis?

Why do I care / ask?

  1. I would like to know about any interesting corner cases or concerns about using this flag. Examples: Are there downsides or risks? Could I corrupt my SonarQube database?
  2. I have a TeamCity cloud with multiple build agents. If more than one agent triggers a build (after multiple, successive version control commits), some SonarQube analyses may overlap.

Solution

  • This property is deprecated since SonarQube 3.5 and no longer necessary. See http://docs.sonarqube.org/display/SONAR/Frequently+Asked+Questions#FrequentlyAskedQuestions-Failedtoanalyseaprojectasanotheranalysisonthesameprojectseemstoberunningatthesametime(SonarQube3.4only)