0

I'm trying to deploy a maven package to a proget server. However whenever I run mvn deploy after a pause I'm getting a error:

[WARNING] Could not transfer metadata com.redacted:rx:0.3.0-SNAPSHOT/maven-metadata.xml from/to redacted (https://proget.redacted/maven2/test_feed_dont_use-SNAPSHOT): Connect to proget.redacted.com:443 [proget.redacted.com/8.8.8.8, proget.redacted/8.8.8.8] failed: Connection timed out: connect

I can connect to the URL using firefox, but not curl. However if I use the curl --insecure option I can. Any idea what might be wrong?

I have tried this command line and it is still giving the same issue.

mvn deploy -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

I am using a proxy, however I have the http_proxy and https_proxy environment variables set which seems to work for other applications. Does maven take note of these?

Martin Brown
  • 24,692
  • 14
  • 77
  • 122

1 Answers1

0

Turns out my problems were caused by a catalogue of issues. Thanks to the commenters for their help pinning some of these down:

  1. maven does not pick the proxy settings up from the http_proxy environment variable. To get around this it needs to be set in the settings.xml file like this:

`

<settings>
  <proxies>
    <proxy>
      <id>localProxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>localhost</host>
      <port>1234</port>
    </proxy>
  </proxies>
</settings>
  1. The certificate that our Proget site is using is not trusted by Java by default. To fix this:

    • Use a web browser to navigate to the Proget admin portal.
    • Use the padlock icon to view the certificate and export it.
    • From the location in environment variable $JAVA_HOME run the following:

    ./bin/keytool -import -alias [someName] -keystore jre/lib/security/cacerts -file ~/certFile.crt

  2. There is a bug in ProGet version 4.2.1 (Build 8) which prevents uploading SNAPSHOT packages. I didn't figure out how to work around this, but decided not to use SNAPSHOTs instead. Apparently the ProGet team are working on a fix for the next release.

Martin Brown
  • 24,692
  • 14
  • 77
  • 122