Mvn sonar:sonar doesn't scan angular files


Sonarqube Enterprise 9.5, sonar-maven-plugin:, Maven 3.8.1

The Maven build uses the frontend-maven-plugin to build frontend and backend.

Source tree

|   +---java
|   [...]
|   +---liberty
|   |   \---config
|   +---ngapp
|    [...]
|   |   +---resources
|   |   \---example
|   \---webapp
|       \---WEB-INF

Plugin config


The scanner context has only


AFAIK it should also automatically include src/main/ngapp and scan the *.ts, *.css, *.scss, *.html files without further configuration in pom.xml !?


Hey Gilbert.

Since sonar.sources defaults to pom.xml,src/main/java – if other directories are already being analyzed (like src\main\webapp), I suspect that somewhere you are defining sonar.sources to include those other directories and need to include the new one as well.

Hey Colin,

we didn’t set any sonar.sources, means those are set default.


It seems the Sonarqube Maven plugin is simply oriented to the Maven standard directory layout, see

So in our case we had to use <sonar.sources>src/main</sonar.sources> to target all files
'(*.java, *.ts, *.css, *.scss, .html,.xml)

IMO the Sonar Maven plugin should use src/main as default value for sonar.source and not
consider only the default Maven directory layout.


Thanks for the feedback @Rebse. I’ll try and find the best folks to answer why we target src/main/java instead of src/main, and whether or not it’s reasonable to expand the scope.

Hello @Rebse,

Thanks for your message. I think that happened when a scanner for maven was implemented, the idea was to use it just for Java projects. Now it makes more sense to be able to scan other projects too. So here is a ticket to improve it:


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.