Sonar scanner for maven

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

Sonarqube version : 7.5 and apache maven version : 3.3.9

I’m trying to do sonar analysis for java project (pom.xml) using TFS 2015 .

I followed the below url to setup sonar scanner for maven
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven

updated my settings.xml file of maven with the below properties

org.sonarsource.scanner.maven
<profiles>
    <profile>
        <id>sonar</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
          <sonar.host.url>http://myserver:9000</sonar.host.url>

<sonar.login>



sorry , the above uploaded only half of my content. I’m continuing here.

After adding above properties to maven settings.xml file, when I run

mvn clean verify sonar:sonar is giving insufficient previlliages error.

2019-05-02T21:25:15.2667476Z [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project core: Insufficient privileges -> [Help 1]

2019-05-02T21:25:15.2667476Z [ERROR]

2019-05-02T21:25:15.2667476Z [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

2019-05-02T21:25:15.2667476Z [ERROR] Re-run Maven using the -X switch to enable full debug logging.

2019-05-02T21:25:15.2667476Z [ERROR]

2019-05-02T21:25:15.2667476Z [ERROR] For more information about the errors and possible solutions, please read the following articles:

2019-05-02T21:25:15.2667476Z [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

2019-05-02T21:25:15.5167603Z ##[error]Unexpected exit code received from Maven: 1

after that I tried by adding sonar.login and sonar.password properties to the settings.xml file.Still get the above insufficient privileges error.

Could any one please help us how can I resolve the above error.

Thanks for your support in advance.

Hi,

Can you provide the full stacktrace?

 
Ann