如何为 lagom / activator / sbt 指定代理凭据?

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

我正在使用 GettingStarted 页面中的 my-first-system 模板试用 Lightbend 的 Lagom。

我在 Windows 10,在公司代理后面。

由于缺少代理凭据,Activator 无法下载某些依赖项。我已经设置了 HTTP_PROXY 环境变量。

激活器报如下错误:

[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

注意:错误消息包含实际的 IPv4 地址,而不是我上面显示的替代地址。

我应该在哪里指定代理的用户名和密码?

我怎样才能以安全的方式做到这一点?

Activator 应该检查系统属性,在您的情况下

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

在文件中 ~/.activator/activatorconfig.txt

这在 https://www.lightbend.com/activator/docs

的常见问题解答部分有详细描述

向下滚动到 "Behind a Proxy" 部分。