当我安装一个jenkins-plugin,比如'git-plugin'时,jenkins会将我的请求重定向到镜像 * ftp.halifax.rwth-aachen.de *。但是我在一个公司代理后面工作,该代理禁止对包含'ftp'一词的URL的请求。
在下载jenkins的插件时,有没有办法选择或禁用镜像?Jenkins从不包含'ftp'的站点安装插件没有问题。
以下是jenkins log-view的错误:
Dez 22, 2016 3:46:54 PM INFORMATION hudson.model.UpdateCenter$DownloadJob run
Starting the installation of Git client plugin on behalf of admin-ci
Dez 22, 2016 3:46:54 PM SCHWERWIEGEND hudson.model.UpdateCenter$DownloadJob run
Failed to install Git client plugin
hudson.util.IOException2: Failed to download from http://updates.jenkins-ci.org/download/plugins/git-client/2.1.0/git-client.hpi (redirected to: http://ftp.halifax.rwth-aachen.de/jenkins/plugins/git-client/2.1.0/git-client.hpi)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1169)
at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1666)
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1864)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1640)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://ftp.halifax.rwth-aachen.de/jenkins/plugins/git-client/2.1.0/git-client.hpi
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1926)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1921)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1920)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1490)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1121)
... 7 more
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://ftp.halifax.rwth-aachen.de/jenkins/plugins/git-client/2.1.0/git-client.hpi
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1876)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2982)
at java.net.URLConnection.getHeaderFieldLong(URLConnection.java:629)
at java.net.URLConnection.getContentLengthLong(URLConnection.java:501)
at java.net.URLConnection.getContentLength(URLConnection.java:485)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1120)
... 7 more
enter code here
字符串
3条答案
按热度按时间disho6za1#
默认情况下,Jenkins使用http://updates.jenkins-ci.org/update-center.json作为“负载均衡器”url,将您转发到最近的地理镜像json(即http://ftp-nyc.osuosl.org/pub/jenkins/updates/current/update-center.json对我来说)。你可以做的是使用你自己的json文件,通过安装这个插件和主机json文件到任何你想要的地方(即内部):
https://wiki.jenkins.io/display/JENKINS/UpdateSites+Manager+plugin的
的数据
g6baxovj2#
我找到了一个解决方案:
1.直接从http://mirrors.jenkins-ci.org/plugins/gitlab-plugin/latest/下载插件
1.将hpi文件上传到jenkins。http://host:8080/pluginManager/advanced中有一个upload字段。
**但这只是一个解决方案。我想得到我的问题的答案:“ 在为jenkins下载插件时,有没有选择或禁用镜像的方法? ”
avwztpqn3#
老实说,这里真实的的解决方案是告诉你的防火墙管理器阻止ftp,而不是阻止含有ftp的url--这是一个可怕的规则。