Analysis JavaScript and Java in one project

Hi, sonarcloud , I create a Github action to analysis a project with both Java and JavaScript using maven command .Both Java and JavaScript were building successful. JavaScript source file was build by plugin in pom.xml file . As a result ,Java source files were analyzed correctly, but none of JavaScript were not.

Project url:

JavaScript source files are udner dolphinscheduler-ui/src folder .

Sonarcloud url:

You can see that at sonarcloud the dolphinscheduler-ui folder is just one pom.xml file .

It seems that because I use maven command , sonarcloud treat the project as Java project and ignore JavaScript .

So,is there a way to analysis one project using both Java and JavaScript ?

I searched some result ,


Nothing has changed so far on the fact that one project must match one repo only.

And I tried this

using sonar.inclusions ,but get “file already indexed” error .

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)

  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
    GitHub action

  • Scanner command used when applicable (private details masked)

name: SonarCloud
on: [push, pull_request]
    name: SonarCloud Trigger
    runs-on: ubuntu-latest
    - uses: actions/checkout@v1
    - uses: actions/setup-java@v1
        java-version: 8
    - uses: actions/cache@v1
        path: ~/.m2/repository
        key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-sonarqube
        restore-keys: |
          ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-sonarqube
          ${{ runner.os }}-maven-
    - name: Maven clean
      run: mvn clean
    - name: Run SonarCloud analyse
      run: >
          mvn clean --batch-mode

        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
  • Languages of the repository
    Java and JavaScript

Hello @Jave-Chen, welcome to the community forum!

It is certainly to analyse both Java and Javascript code with the Maven scanner.
In your case adding


to the dolphinscheduler-ui/pom.xml should make the the analyser detect your Javascript files as well.

Hope that helps,

Wow, Tom you really given me a big favor. It worked.Thank you very much.
Further more, Can you tell me why Maven scanner ignore JavaScript files when I didn’t add sonar.sources ?

BTW, should be sonar.sources.


When launching a sonar analysis through maven, the Java sources automatically get added because of the Maven src/main/java convention. The same convention does not exist for other languages so their location has to be manually specified.

Thanks, I fixed that.