连接到公司 VPN 时,IntelliJ 无法解析 jsDependency

IntelliJ cannot resolve jsDependency when connected to corporate VPN

当我连接到公司的 VPN 时,IntelliJ 无法解析某些 jsDependencies。

我在 IntelliJ 中设置了代理设置以指向我的公司代理服务器,但这似乎没有什么区别。

如果我断开与 VPN 的连接,那么一切都会正常运行...

Error:Error while importing SBT project:<br/>...<br/><pre>[info] 
Resolving org.eclipse.jetty#jetty-util;8.1.16.v20140903 ...
[info] Resolving org.eclipse.jetty#jetty-io;8.1.16.v20140903 ...
[info] Resolving org.eclipse.jetty#jetty-http;8.1.16.v20140903 ...
[info] Resolving org.eclipse.jetty#jetty-server;8.1.16.v20140903 ...
[info] Resolving org.eclipse.jetty.orbit#javax.servlet;3.0.0.v201112011016 ...
[info] Resolving org.eclipse.jetty#jetty-continuation;8.1.16.v20140903 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.webjars#jquery;2.1.3: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]      org.webjars:jquery:2.1.3 ((org.scalajs.sbtplugin.ScalaJSPluginInternal) ScalaJSPluginInternal.scala#L996)
[warn]        +- weatherreportui5:weatherreportui5_sjs0.6_2.11:0.1
[trace] Stack trace suppressed: run 'last *:ssExtractDependencies' for the full output.
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[error] (*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: org.webjars#jquery;2.1.3: not found
[error] (*:update) sbt.ResolveException: unresolved dependency: org.webjars#jquery;2.1.3: not found
[error] Total time: 1 s, completed 04-Sep-2017 17:31:13</pre><br/>See complete log in <a href="file:/Users/xxxxxx/Library/Logs/IdeaIC2017.2/sbt.last.log">file:/Users/i003638/Library/Logs/IdeaIC2017.2/sbt.last.log</a>

sbt.last.log 文件抱怨:

[error] Server access Error: Connection refused url=https://repo1.maven.org/maven2/org/webjars/jquery/2.1.3/jquery-2.1.3.pom
[warn]  module not found: org.webjars#jquery;2.1.3
[warn] ==== local: tried
[warn]   /Users/xxxxxx/.ivy2/local/org.webjars/jquery/2.1.3/ivys/ivy.xml
[warn] ==== local-preloaded-ivy: tried
[warn]   /Users/xxxxxx/.sbt/preloaded/org.webjars/jquery/2.1.3/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////Users/xxxxxx/.sbt/preloaded/org/webjars/jquery/2.1.3/jquery-2.1.3.pom
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/webjars/jquery/2.1.3/jquery-2.1.3.pom

如果这是我公司代理服务器的问题,那么我不确定为什么将 Maven URL 放入我的浏览器(当连接到 VPN 时)会毫无问题地显示 POM 文件。

此外,sbt.last.log 中显示的 Ivy2 缓存路径名与磁盘上缓​​存的实际路径不匹配。应该是~/.ivy2/cache。

有什么想法吗?

谢谢

是IntelliJ中的VM参数设置。

首选项 -> 构建、执行和部署 -> SBT。

需要添加:

-Dhttp.proxyHost=hostname
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=hostname
-Dhttps.proxyPort=8080