Search code examples
mavenartifactorymaven-plugin

Maven Artifactory Plugin and Corporate Proxy


We are running a CI/CD Pipeline behind a corporate HTTP Proxy. So far all works fine, but the artifactory-maven-plugin seems to ignore our proxy settings in the /root/.m2/settings.xml file.

We receive a timeout, but downloading the dependencies for the build and test works fine. So in general network connectivity trough proxy works.

[WARNING] Error occurred for request GET /artifactory/api/system/version HTTP/1.1: Connect to artifactory.x.eu:443 [artifactory.x.eu/167.x.x.201] failed: Connection timed out.
[WARNING] Error occurred for request GET /artifactory/api/system/version HTTP/1.1: Connect to artifactory.x.eu:443 [artifactory.x.eu/167.x.x.201] failed: Connection timed out.

I expect that the upload of artifacts trough the http proxy works. The debug log shows no sign of using the proxy.


Solution

  • Currently, the Maven Artifactory plugin does not read the proxy configuration from the settings.xml.

    However, you can still use an HTTP proxy today by providing the following system properties:

    mvn clean install -Dartifactory.proxy.host=proxy.jfrog.io -Dartifactory.proxy.port=8888 -Dartifactory.proxy.username=proxyUser  -Dartifactory.proxy.password=proxyPass
    

    Additionally, to fully support HTTP proxy by the plugin's configuration in the pom.xml or from the settings.xml as you did, I created this PR: https://github.com/jfrog/artifactory-maven-plugin/pull/64.

    Read more about the Maven Artifactory plugin in the documentation: https://www.jfrog.com/confluence/display/JFROG/Maven+Artifactory+Plugin