How to use sbt from behind proxy - in windows 7?

后端 未结 4 1835
情深已故
情深已故 2020-12-30 10:48

I am trying to run SBT on Windows 7. To do so I followed the steps in the similar thread \"How to use sbt from behind proxy?\".

I have the foll

相关标签:
4条回答
  • 2020-12-30 11:34

    sbt uses Gigahorse with OkHttp for parallel downloading. You can try turning it off by passing -Dsbt.gigahorse=false.

    Another thing you could try is turning off https, and use http by passing -Dsbt.repository.secure=false

    Reference: https://github.com/sbt/sbt/issues/4307

    0 讨论(0)
  • 2020-12-30 11:35

    Thank you Paweł for your answer.

    This is what I found out:

    "-Dhttp.proxySet=true" doesn't have any effect (for me at least)

    The settings are prioritized in the following order:

    SBT_OPTS overrides JAVA_OPTS overrides %SBT_HOME%conf\sbtconfig.txt

    The Solution is either to set one of the environmental variables

    JAVA_OPTS=-Dhttp.proxyHost=192.168.0.150 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=192.168.0.150 -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost
    

    OR

    SBT_OPTS=-Dhttp.proxyHost=192.168.0.150 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=192.168.0.150 -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost
    

    OR to edit the %SBT_HOME%conf\sbtconfig.txt file :

    ***** sbtconfig.txt BEGINNING (hashtags in this file have been replaced by stars) *****
    
    *Set the java args to high
    
    -Xmx512M
    
    *-XX:MaxPermSize=256m
    
    -XX:ReservedCodeCacheSize=128m
    
    *Set the extra SBT options
    
    -Dsbt.log.format=true
    
    *Proxy settings
    
    -Dhttp.proxyHost=192.168.0.150 
    
    -Dhttp.proxyPort=8080
    
    -Dhttps.proxyHost=192.168.0.150 
    
    -Dhttps.proxyPort=8080
    
    ***** sbtconfig.txt END *****
    
    0 讨论(0)
  • 2020-12-30 11:43

    Let's take a look at your errors:

    :::: ERRORS Server access Error: Connection timed out: connect url=https://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.jansi/jansi/1.11.ivys/ivy.xml
    

    Sbt is trying to use https, but you don't have proxy configuration for it. Try setting https proxy variables:

    • https.proxyHost
    • https.proxyPort

    I guess you could try the same values as for http proxy.

    0 讨论(0)
  • 2020-12-30 11:45

    Go to your SBT folder and use the below command

    set SBT_OPTS=-Dhttp.proxyHost=10.10.10.154 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=10.10.10.154 -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost <Enter your IP settings >
    

    and then

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