13

I have a java maven web project, I have also Jenkins 1.620 and SonarQube 5.1.1.

I have added in jenkins a maven post action with SonarQube setting the jdk as 7u79, the same used by the project.

When I run the jenkins task, I get on the console next error:

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project *****: The svn blame command [svn blame --xml --non-interactive -x -w src/main/java/*****.java] failed: svn: PROPFIND request failed on '/*****/trunk/src/main/java/*****.java'
[ERROR] svn: PROPFIND of '/*****/trunk/src/main/java/*****.java': authorization failed (http://*****.*****.*****)
[ERROR] -> [Help 1]

It seems that I have to put login information for SVN in SonarQube task for a Maven project in Jenkins, but I have not found any documentation on that, and I do not know if it should be as MAVEN_OPTS or Additional Properties, and also the syntaxis.

Thanks in advance.

4 Answers 4

18

You can configure it on the SonarQube server:

Global: Settings → General → SCM → SVN

Per project: Settings → General Settings → SCM → SVN

5

In case it might help, here is an alternative way to do it based on this thread in a google group.

Mind you, it is certainly less secure than set the SVN user and pwd in SonarQube server, but it might help as a temporary workaround:

In the Jenkins job >> SonarQube Scanner Build Step >> Analysis Properties

Set the two properties below:

sonar.svn.username=<SVN USERNAME>
sonar.svn.password.secured=<SVN PASSWORD>

Note that the password is actually not secured at all, since it is not encrypted. Therefore a nice move is to set it in a password variable in Jenkins and to pass this variable in the sonar.svn.password.secured property value. This way it is, at least, not readable.

1
  • 1
    i had the same issue , this worked like a charm , thanks a lot Apr 24, 2020 at 15:24
2

In 6.7.x ,you can find in Administration -> Configuration -> General Settings → SCM → SVN . But svn option can only be seen if you install svn plugin in market.

1

In sonarqube 6.x.x, you can find the configuration in : Administration -> Configuration -> SCM

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.