Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven with sonar authentication

I am running maven with sonar. Since I activated authentication on sonar for security purposes, since then I got the following error:

[ERROR] Can´t access to Sonar or project doesn't exist on Sonar instance. HTTP KO to http://localhost:9000/api/resources?resource=com.myproject.soft:soft&depth=0&format=xml
java.io.IOException: Can´t access to Sonar or project doesn't exist on Sonar instance.
        at org.sonar.report.pdf.util.SonarAccess.getUrlAsDocument(SonarAccess.java:132)
        at org.sonar.report.pdf.entity.Project.initializeProject(Project.java:98)

according to http://docs.sonarqube.org/display/SONAR/Analyzing+with+Maven I should use the following parameters:

-Dsonar.login=login -Dsonar.password=password

Those settings are not working for me.

The full command I am using is:

mvn install sonar:sonar -Dsonar.login=login -Dsonar.password=password
like image 608
Hugo Avatar asked Apr 30 '13 12:04

Hugo


2 Answers

This is a limitation of the PDF Report Plugin that is developed by Klicap:

http://jira.codehaus.org/browse/SONARPLUGINS-1510

If you remove this plugin, then everything should be back to normal.

like image 111
Fabrice - SonarSource Team Avatar answered Oct 23 '22 00:10

Fabrice - SonarSource Team


We have the same problem and resolved it by adding some credentials. Tested on Sonar 3.7 and Sonar PDF Plugin 1.3

In eclipse put this as your maven Goals:

org.codehaus.sonar-plugins.pdf-report:maven-pdfreport-plugin:1.3:generate -Dsonar.host.url=http://localhost:9000 -Dreport.type=executive -Dsonar.pdf.username=admin -Dsonar.pdf.password=admin
like image 41
jjcosare Avatar answered Oct 23 '22 01:10

jjcosare