Yesterday I downloaded Sonar and scanned my Angular/TS project by running this inside the project folder in cmd: sonar-scanner.bat -D"sonar.projectKey=Angular1" -D"sonar.sources=." -D"sonar.host.url=http://localhost:9000" -D"sonar.login=<token value>"
, noticed it found something it’s not exists at all which was deleted completely from the folder a while ago. After some study I realized it’s pulling from the .git folder.
sonarqube=8.9.0.43852, Windows 10 (64-bit), VSC=1.56.2, Angular=11
what are you trying to achieve = Tell Sonar not to look into .git folder at all, so it just focuses on latest build.
what have you tried so far to achieve this = Manually removed the outdated and no-long-exists content from local git using Git Bash.
SCM integration is essential if you want to track who modifies codes of lines, which can be linked to issues in SonarQube. If you not interested in assigning issues based on the git annotation data, you can skip such information by setting sonar.scm.disabled=false so in your case: -D"sonar.scm.disabled=false".
Joe
EDIT: I meant to set to true, not false! sonar.scm.disabled=true
You can set it in sonar-project.properties or at your sonar-scanner.bat command line. Either place will work. You use sonar-project.properties file if you want to preserve the details of project-specific sonar-scanner properties without having to enter it everytime at the command line.
Sorry to ping you again, but after 2nd thought, it seems the behavior you are seeing may be unusual and I’d like to see some more of the issue you are seeing. Can you share the DEBUG logs (add -X to sonar-scanner.bat command) with sonar.scm.disabled=false (yes, false since we want to see what you initial errors look like)?