Error while setting up SonarCloud for a multimodule Maven project

Project is hosted on:

secret was added to github or to env variables, and properties where added to core/pom.xml at integration · opencellsoft/core · GitHub

Different solutions where tested:

  1. First Test
    As suggested by the Sonarcloud configuration page the below properties where added but we got an error


    Project 'opencellsoft_core' can't have 2 modules with the following key: opencellsoft_core

  2. Second attempt
    transform the projectkey to
    You're not authorized to run analysis. Please contact the project administrator.

  3. 3rd Attempt
    Add modulekey properties
    <sonar.projectKey>opencellsoft_core</sonar.projectKey> <sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
    You're not authorized to run analysis. Please contact the project administrator.

Do you have any idea how to resolve this issue ?


Hi Wassim,

Welcome to the community!

Your third example is basically correct. The top level POM should have the following:


The basic idea is that for a multi-module analysis you only need to “sonarify” the top level POM and, in particular, add a parameterized sonar.moduleKey element, which you have done.

The error you are getting, “You’re not authorized to run analysis”, suggests that you may be using an incorrect project key or organization key. Or that you have not configured the correct SONAR_TOKEN environment variable / secret. Can you check these?

1 Like

I forked your repo and I was able to get an analysis using the equivalent of the above configuration (except I used my own project key and organization). Can you confirm that it works for you?

1 Like

Yes I confirm that the issue was resolved on adding the secret token in Repository secrets instead of environment secrets in Github


By the way. While investigating this issue I found an problem where the scanner was throwing errors related to the Java version.

I was able to fix this by using the most recent version of the scanner plugin: version


I suggest you make this change to your top level POM.

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