简体   繁体   English

在 Jenkins 1.620 SonarQube 5.1.1 中运行声纳分析时,SVN 身份验证失败

[英]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.我有一个 java maven web 项目,我还有Jenkins 1.620SonarQube 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.我在 jenkins 中添加了一个 maven post action,SonarQube 将 jdk 设置为 7u79,与项目使用的相同。

When I run the jenkins task, I get on the console next error:当我运行 jenkins 任务时,我在控制台上遇到下一个错误:

[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.似乎我必须在 Jenkins 中的 Maven 项目的SonarQube任务中放置SVN登录信息,但我没有找到任何相关文档,我不知道它是否应该作为MAVEN_OPTS或附加属性,以及语法.

Thanks in advance.提前致谢。

You can configure it on the SonarQube server:您可以在 SonarQube 服务器上配置它:

Global: Settings → General → SCM → SVN全局:设置 → 通用 → SCM → SVN

Per project: Settings → General Settings → SCM → SVN每个项目:设置 → 常规设置 → 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:请注意,它肯定不如在 SonarQube 服务器中设置 SVN 用户和密码安全,但作为临时解决方法可能会有所帮助:

In the Jenkins job >> SonarQube Scanner Build Step >> Analysis Properties在詹金斯工作>> SonarQube 扫描仪构建步骤>> 分析属性

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.因此,一个不错的举措是将其设置在 Jenkins 的密码变量中,并将此变量传递到sonar.svn.password.secured属性值中。 This way it is, at least, not readable.这样,至少,它是不可读的。

In 6.7.x ,you can find in Administration -> Configuration -> General Settings → SCM → SVN .在 6.7.x 中,您可以在 Administration -> Configuration -> General Settings → SCM → SVN 中找到。 But svn option can only be seen if you install svn plugin in market.但是 svn 选项只有在市场上安装了 svn 插件才能看到。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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