Search code examples
proxysbttypesafe-activatorlagom

How to specify proxy credentials for lagom / activator / sbt?


I am trying out Lagom from Lightbend, using the my-first-system template from the GettingStarted page.

I am on Windows 10, and behind a corporate proxy.

Activator fails to download some dependencies due to missing credentials for the proxy. I have set the HTTP_PROXY environment variable.

The following error is reported by activator:

[info] Updating {file:/E:/Projects/LagomHelloWorld/my-first-system/project/}my-first-system-build...
[info] Resolving com.lightbend.lagom#lagom-sbt-plugin;1.0.0 ...
[error] Server access Error: Connection timed out: connect url=https://repo.typesafe.com/typesafe/ivy-releases/com.lightbend.lagom/lagom-sbt-plugin/scala_2.10/sbt_0.13/1.0.0/ivys/ivy.xml
[error] Server access Error: Connection timed out: connect url=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.lightbend.lagom/lagom-sbt-plugin/scala_2.10/sbt_0.13/1.0.0/ivys/ivy.xml
[error] Server access Error: Connection timed out: connect url=https://repo1.maven.org/maven2/com/lightbend/lagom/lagom-sbt-plugin_2.10_0.13/1.0.0/lagom-sbt-plugin-1.0.0.pom
[error] Unable to find credentials for [ @ <proxy-ipv4-addr> ].
[warn]  module not found: com.lightbend.lagom#lagom-sbt-plugin;1.0.0

Note: The error message contains the actual IPv4 address, not the substitute I show above.

Where should I specify the user id and password for the proxy?

How can I do that in a secure way?


Solution

  • Activator should check for system properties, in your case

    #-Dhttp.proxyUser=PUT YOUR PROXY USER HERE
    #-Dhttp.proxyPassword=PUT YOUR PROXY PASSWORD HERE
    

    in a file ~/.activator/activatorconfig.txt.

    This is described in detail in the FAQ section on https://www.lightbend.com/activator/docs

    Scroll down to the section "Behind a Proxy".