- which versions are you using?
The free version 7.7
- what are you trying to achieve
Set up my first project and a scanner for it
How to debug when sonar-scanner finds 0 files?
I’m new to SonarQube. I’m using the free version 7.7. I tried to set up a demo sonar-scanner run on some pre-existing source files, and my problem is that the scanner is finding 0 files. But there are plenty of .js files in my directory hierarchy. I’m using sonar-project.properties with settings for both sonar.projectBaseDir and sonar.sources. On the SonarQube server I’ve set the project’s Analysis Scope for Source File Inclusions of *.js. The SonarQube server Overview for my project reports all of my analysis run attempts, but it reports “This project is empty”.
I’m not seeing any way to debug this problem. The debug -X option on sonar-scanner doesn’t report which hierarchy of directories it is trying. What to try next?
This might be related to the popular “This project is empty” thread. Although in my case I have never had a non-empty project.
Here’s some interesting output from the sonar-scanner client command line:
12:00:03.651 INFO: Indexing files…
12:00:03.651 INFO: Project configuration:
12:00:03.652 INFO: Included sources: *.js
12:00:03.666 DEBUG: readpipe [git, --version],/usr/bin
12:00:03.671 DEBUG: readpipe may return ‘git version 2.17.1’
12:00:03.671 DEBUG: remaining output:
12:00:03.671 DEBUG: readpipe [git, config, --system, --edit],/usr/bin
12:00:03.674 DEBUG: readpipe may return ‘/etc/gitconfig’
12:00:03.674 DEBUG: remaining output:
12:00:03.712 DEBUG: 0 non excluded files in this Git repository
12:00:03.764 INFO: 0 files indexed
12:00:03.764 INFO: 0 files ignored because of inclusion/exclusion patterns
12:00:03.764 INFO: 0 files ignored because of scm ignore settings
12:00:03.765 INFO: ------------- Run sensors on module my_project
12:00:04.902 INFO: Calculating CPD for 0 files