SonarQube 5.3 - 下载代理后面的插件 (HTTPS)

SonarQube 5.3 - Download plugins behind proxy (HTTPS)

关于这个已经有 of questions,但是 none 提供的解决方案适用于 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))

非常感谢任何帮助。

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

HTTPS 代理属性(https.proxyHosthttps.proxyPort必须sonar.web.javaAdditionalOpts 中设置,因为它们不是 understood/suppoerted在 sonar.properties.

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

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

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