How to use sbt behind authenticated proxy?

让人想犯罪 __ 提交于 2020-01-02 07:26:09

问题


As given in other answers. I have properly set the value of http proxy host and port. but it is giving the following error

Getting org.scala-sbt sbt 0.13.6 ...

You probably access the destination server through a proxy server that is not well configured. You probably access the destination server through a proxy server that is not well configured. You probably access the destination server through a proxy server that is not well configured.

:: problems summary :: :::: WARNINGS Host repo.typesafe.com not found. url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.6/ivys/ivy.xml

Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.6/sbt-0.13.6.pom

Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.6/sbt-0.13.6.jar

    module not found: org.scala-sbt#sbt;0.13.6

==== local: tried

  /home/vibhanshu/.ivy2/local/org.scala-sbt/sbt/0.13.6/ivys/ivy.xml

  -- artifact org.scala-sbt#sbt;0.13.6!sbt.jar:

  /home/vibhanshu/.ivy2/local/org.scala-sbt/sbt/0.13.6/jars/sbt.jar

==== typesafe-ivy-releases: tried

  https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.6/ivys/ivy.xml

==== Maven Central: tried

  https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.6/sbt-0.13.6.pom

  -- artifact org.scala-sbt#sbt;0.13.6!sbt.jar:

  https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.6/sbt-0.13.6.jar

    ::::::::::::::::::::::::::::::::::::::::::::::

    ::          UNRESOLVED DEPENDENCIES         ::

    ::::::::::::::::::::::::::::::::::::::::::::::

    :: org.scala-sbt#sbt;0.13.6: not found

    ::::::::::::::::::::::::::::::::::::::::::::::

:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS unresolved dependency: org.scala-sbt#sbt;0.13.6: not found Error during sbt execution: Error retrieving required libraries (see /home/vibhanshu/.sbt/boot/update.log for complete log) Error: Could not retrieve sbt 0.13.6


回答1:


If you are in behind the proxy(corporate network) For windows :

In sbt installation folder, go to conf/sbtconfig.txt file just add the following lines and save and try.

-Dhttp.proxyHost=proxy
-Dhttp.proxyPort=portno
-Dhttp.proxyUser=UserId
-Dhttp.proxyPassword=Password

-Dhttps.proxyHost=proxyhost
-Dhttps.proxyPort=portno 
-Dhttps.proxyUser=UserId
-Dhttps.proxyPassword=Password

For Linux/Unix:

 export JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=proxyHost  -Dhttp.proxyPort=proxyPortNumber -Dhttp.proxyUser=UserId -Dhttp.proxyPassword=Password -Dhttps.proxyHost=proxyHost -Dhttps.proxyPort=proxyPortNumber  -Dhttps.proxyUser=UserId -Dhttps.proxyPassword=Password"

It worked for me too.




回答2:


I added the following line to .bashrc.

export JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=proxy -Dhttp.proxyPort=port -Dhttps.proxyHost=proxy -Dhttps.proxyPort=port"

It works fine.




回答3:


I was facing the same issue (behind corporate firewall and getting this error message) and I tried all the options from various related threads but none of them resolved the problem. I was able to finally get IntelliJ to work by configuring HTTP Proxy in IntelliJ itself. Here's what my configurations look like (Note: provide your network username and password in related boxes):-



来源:https://stackoverflow.com/questions/26582300/how-to-use-sbt-behind-authenticated-proxy

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