SonarQube 6.1 Executing Analysis Permissions

We would like to allow any user to run SonarQube preview analysis (authenticated or not). However, we would like to limit who can upload the analysis to the server.

To allow all users to perform preliminary analysis, the documentation indicates that someone needs access to view and perform analysis.

However, it looks like running the maven sonar plugin on the command line still requires sonar log and sonar. password.

In addition, we would like to restrict who can download the analysis to only the Sonar Admin group.

Here is a screenshot of our project permissions: project permissions

Here's a screenshot of our global permissions: global permissions

Unsuccessful command:

mvn -o org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar -Dsonar.analysis.mode=preview -Dsonar.branch=$BRANCH -Dsonar.host.url=$SONAR_URL -Dsonar.skipPackageDesign=true -Dsonar.report.export.path=sonar-report.json

      

Successful team:

mvn -o org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar -Dsonar.analysis.mode=preview -Dsonar.branch=$BRANCH -Dsonar.host.url=$SONAR_URL -Dsonar.skipPackageDesign=true -Dsonar.report.export.path=sonar-report.json -Dsonar.login=%SONAR_USERNAME% -Dsonar.password=%SONAR_PASSWORD%

      

Please help me fine-tune our access settings so that we achieve the goal of allowing preliminary analysis but excluding analysis.

Here are some excerpts from the failed work. I have removed some company-specific details.

    > mvn -o org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar -Dsonar.analysis.mode=preview -Dsonar.branch=$BRANCH -Dsonar.host.url=$SONAR_URL -Dsonar.skipPackageDesign=true -Dsonar.report.export.path=sonar-report.json
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=512m; support was removed in 8.0
...
[INFO] Performing issue tracking
[INFO] 772/772 components tracked
[WARNING] Console report is deprecated. Use SonarLint CLI to have local reports of issues
[INFO]
-------------  Issues Report  -------------
       +13 issues
        +1 blocker
        +1 critical
        +3 major
        +8 minor
     -------------------------------------------
     [INFO] Export issues to c:\Source\releases\vcmmigrationmgr\vcmmigrationmgr-app\target\sonar\sonar-report.json
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 35.933 s
[INFO] Finished at: 2017-04-25T10:59:46-05:00
[INFO] Final Memory: 100M/3582M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project vcmmigrationmgr-app: Not authorized. Analyzing this project requires to be authenticated. Please provide the values of the properties sonar.login and sonar.password. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

      

Edit: I removed Run Analysis with Anyone permission. I also removed "-Dsonar.report.export.path = sonar-report.json" from the command. I don't understand why a username and password is required for the preview mode. Is there a way to let anonymous users work in preview mode?

+3


source to share





All Articles