Jenkins error when publishing artifact to Artifactory
I solved the issue simply by changing the http
protocol to https
in the artifactory server URL (Jenkins -> Manage Jenkins -> Configure System -> Artifactory).
So instead of Artifactory servers URL:
http://my.artifactory.server/artifactory
I have Artifactory servers URL:
https://my.artifactory.server/artifactory
Explanation
My artifactory server sits behind nginx
proxy, which responds with HTTP 301
(redirection) to http
protocol requests. Jenkins artifactory plugin doesn't handle such redirections and requires a direct URL.
You can check if your URL is direct or not using culr
:
curl -l http://my.artifactory.server/artifactory
response:
<html><head><title>301 Moved Permanently</title></head><body bgcolor="white"><center><h1>301 Moved Permanently</h1></center><hr><center>nginx/1.6.3</center></body></html>
It appears that upgrading to Artifactory 3.6.0 resolved the problem. Now using Jenkins 1.605 and Artifactory 3.6.0 and not seeing the problem any longer.
I had the same problem. I solved it by adding the artifactory url to non-proxy hosts as belowManage Jenkins -> Configure System -> Global PropertiesCheck Environment Variables, and configure the properties with a name as below
-Dgradle.user.home=<your .gradle path> -Dhttp.proxyHost=<httpProxy> -Dhttp.proxyPort=<port_of_httpProxyHost> **-Dhttp.nonProxyHosts=<your_artifactory_url>** -Dhttps.proxyHost=<httpsProxy> -Dhttps.proxyPort=<port_of_httpsProxyHost>