简体   繁体   中英

SVN authentication failure when running a Sonar analysis in Jenkins 1.620 SonarQube 5.1.1

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.

You can configure it on the SonarQube server:

Global: Settings → General → SCM → SVN

Per project: Settings → General Settings → SCM → SVN

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.

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.

在 sonarqube 6.xx 中,您可以在以下位置找到配置:Administration -> Configuration -> SCM

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM