Where can I set proxy for SBT in Intellij IDEA?

前端 未结 6 534
深忆病人
深忆病人 2021-01-30 17:19

I am using Intellij IDEA 14.1.3 edition and have installed Scala plugin. When creating SBT project, it reports the following error:

相关标签:
6条回答
  • 2021-01-30 17:43

    Add parameter VM

    -Dhttps.proxyHost=hostName 
    -Dhttps.proxyPort=portUse 
    -Dhttps.proxyUser=proxyName 
    -Dhttps.proxyPassword=proxyPaword
    

    It work for me

    0 讨论(0)
  • 2021-01-30 17:52

    In my situation I have tried all above solutions, but they did not work.

    In the end I have configured HTTP proxy for the whole IntellJ, and that have resolved my issues.

    Settings > Appearance & Behaviour > System Settings > Http Proxy
    

    0 讨论(0)
  • 2021-01-30 17:53

    Add -Dhttp.proxyHost=<proxy_server> -Dhttp.proxyPort=<proxy_port> to VM parameters

    Read documentation for more info

    0 讨论(0)
  • 2021-01-30 17:54

    Basically there are three ways of setting the proxy. Each of them seems to affect a different part of the IDE.

    For all following three methods I recommend setting both, http and https, since most connections to repos are established using https nowadays:

    -Dhttp.proxyHost=yourProxyAdress 
    -Dhttp.proxyPort=yourPort 
    -Dhttp.proxyUser=yourUsername 
    -Dhttp.proxyPassword=yourPassword 
    -Dhttps.proxyHost=yourProxyAdress
    -Dhttps.proxyPort=yourPort 
    -Dhttps.proxyUser=yourUsername 
    -Dhttps.proxyPassword=yourPassword 
    

    1. Build Tools

    Setting the proxy under "Build, Execution, Deployment" > "Build Tools" > "SBT" > "VM parameters" affects the SBT process that is executed after editing the build.sbt file and refreshing the latter. Also, this is used for indexing (and therefore auto completion). This setting will also affect the download of SBT itself in the version you selected during project setup.

    2. Other Settings

    Aditionally, I used the setting under "Other Settings" > "SBT" > "VM parameters"

    3. Setting the proxy globally

    Another way would be to set the proxy settings globally with your JAVA_OPTS as described here.

    0 讨论(0)
  • 2021-01-30 18:08

    If you are running a sbt-based scala project you may need to add the proxy in the run configuration of the project: Run -> Edit configurations...->->VM parameters

    0 讨论(0)
  • 2021-01-30 18:08

    I was seeing this same error message and tried all the suggestions mentioned in multiple (related) threads. I was able to finally resolve the problem by setting up the HTTP Proxy directly in IntelliJ. Here's what my settings look like (Note: specify your network username and password in the corresponding boxes):-

    0 讨论(0)
提交回复
热议问题