【问题标题】:SonarQube 5.3 - Download plugins behind proxy (HTTPS)SonarQube 5.3 - 在代理 (HTTPS) 后面下载插件
【发布时间】:2016-06-13 02:03:08
【问题描述】:

已经有 couplequestions 与此有关,但所提供的解决方案均不适用于 SonarQube v5.3。

到目前为止,我已经尝试设置 sonar.web.javaAdditionalOpts=-Dhttps.proxyHost=proxy.XXX -Dhttps.proxyPort=YYYhttp(s).proxyHost=proxy.XXXhttp(s).proxyPort=YYY

重要的是要注意,当 SonarQube 启动时(我正在运行 docker 应用程序)它会尝试连接到 http://update.sonarsource.org/update-center.properties,在这种情况下我可以检查 http 代理是否有效:

sonar_1 | 2016.02.29 20:46:18 INFO  web[o.s.s.p.UpdateCenterClient] Update center: http://update.sonarsource.org/update-center.properties (HTTP proxy: proxy.XXX:YYY)

但是,当尝试从更新中心下载任何插件时,它会失败:

sonar_1 | org.sonar.api.utils.SonarException: Fail to download the plugin (ldap, version 1.5.1) from https://sonarsource.bintray.com/Distribution/sonar-ldap-plugin/sonar-ldap-plugin-1.5.1.jar (error is : Fail to download: https://sonarsource.bintray.com/Distribution/sonar-ldap-plugin/sonar-ldap-plugin-1.5.1.jar (no proxy))

非常感谢任何帮助。

编辑:根据使用的配置添加相关的调试日志。

  • 仅使用sonar.web.javaAdditionalOpts=-Dhttps.proxyHost=http://proxy.XXX -Dhttps.proxyPort=YYY -Dhttp.proxyHost=proxy.XXX -Dhttp.proxyPort=YYYgist

  • 使用http.proxyHosthttp.proxyPorthttps.proxyHosthttps.proxyPortgist

【问题讨论】:

  • 把一般准则放在一边,专注于一个精确的问题:你能在sonar.web.javaAdditionalOpts 中设置http.proxyHost/Port https.proxyHost/Port,将sonar.log.level 切换为DEBUG 和分享更多失败的日志?
  • @n_stan 当然,我会编辑我的帖子。

标签: configuration proxy sonarqube sonarqube5.3


【解决方案1】:

HTTPS 代理属性(https.proxyHosthttps.proxyPort必须sonar.web.javaAdditionalOpts 中设置,因为它们在 sonar.properties 中不被理解/支持。

HTTP 代理属性(http.proxyHosthttp.proxyPort)可以在sonar.web.javaAdditionalOptssonar.properties 中直接设置。

但请注意:如果您在 sonar.web.javaAdditionalOpts 中设置 HTTP,请务必在 sonar.properties 中注释掉 http.proxyHosthttp.proxyPort 行。否则后者会覆盖前者(我觉得这就是你的 gist1 可能发生的事情)。

编辑:您在 docker 容器中运行 SonarQube,在这种情况下,sonar.web.javaAdditionalOptscurrently setrun.sh 脚本中。对于其他 Java 属性,您必须直接对其进行修改。

【讨论】:

  • 实际上 none 我使用的选项都有效。正如要点所示,我尝试了两种解决方案。 gist1 仅显示正在定义的 sonar.web.javaAdditionalOpts
  • 你能分享一下你在 gist1 中使用的sonar.properties 吗?
  • 不完全是,我的意思是完整的sonar.properties 文件,其中定义了所有其他属性。查看 gist1 场景中传递给 SonarQube 的所有属性。
  • 嗯,就是这样。该文件只有那 2 行
  • 好的。您可以共享从第一行一直到 gist1 中显示的错误的完整服务器启动日志吗?谢谢
猜你喜欢
  • 2016-01-20
  • 2013-07-31
  • 2016-10-24
  • 1970-01-01
  • 1970-01-01
  • 2015-12-08
  • 2013-11-02
  • 1970-01-01
  • 2012-08-06
相关资源
最近更新 更多