Need Proxy?

BotProxy: Rotating Proxies Made for professionals. Really fast connection. Built-in IP rotation. Fresh IPs every day.

Find out more


How to use sbt behind authenticated proxy?

Question

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

Answer

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.

cc by-sa 3.0