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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31470594/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 18:40:29  来源:igfitidea点击:

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

javamavensvnjenkinssonarqube

提问by gbelin

I have a java maven web project, I have also Jenkins 1.620and 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 SVNin SonarQubetask 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_OPTSor Additional Properties, and also the syntaxis.

看来,我必须把登录信息,SVNSonarQube任务中詹金斯Maven项目,但我还没有找到任何文件上,我不知道是否应该作为MAVEN_OPTS或其他属性,也是大成。

Thanks in advance.

提前致谢。

回答by agabrys

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

回答by avi.elkharrat

In case it might help, here is an alternative way to do it based on this threadin 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.securedproperty value. This way it is, at least, not readable.

请注意,密码实际上根本不安全,因为它没有加密。因此,一个不错的举措是将其设置在 Jenkins 的密码变量中,并将此变量传递到sonar.svn.password.secured属性值中。这样它至少是不可读的。

回答by yuxh

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.

在 6.7.x 中,您可以在 Administration -> Configuration -> General Settings → SCM → SVN 中找到。但是 svn 选项只有在市场上安装了 svn 插件才能看到。

回答by VinceF

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

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