IntelliJ cannot resolve jsDependency when connected to corporate VPN

六眼飞鱼酱① 提交于 2021-02-08 07:41:07

问题


When I'm connected to my company's VPN, IntelliJ is unable to resolve certain jsDependencies.

I have set proxy settings in IntelliJ to point to my corporate proxy server, but this seems to make no difference.

If I disconnect from the VPN, then everything builds fine...

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>

The sbt.last.log file complains:

[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

If this is a problem with my company's proxy server, then I'm not sure why putting the Maven URL into my browser (when connected to the VPN) displays the POM file without any problems.

Also, the path name to the Ivy2 cache shown in sbt.last.log does not match the actual path to the cache on disk. It should be ~/.ivy2/cache.

Any ideas?

Thanks


回答1:


It was the VM parameter settings in IntelliJ.

Preferences -> Build, Execution and Deployment -> SBT.

Needed to add:

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


来源:https://stackoverflow.com/questions/46041732/intellij-cannot-resolve-jsdependency-when-connected-to-corporate-vpn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!