Search code examples
buildsbtfatal-erroraccess-denied

SBT buid error:[error] Server access Error: Received fatal alert: access_denied


I have been getting server access denied error.Unable to find the fix.Investigated through web.But none of them worked well.I am using windows7.

C:\Users\thathine>sbt
    Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; sup
    port was removed in 8.0
    [info] Loading project definition from C:\Users\thathine\project
    [info] Updating {file:/C:/Users/thathine/project/}thathine-build...
    [info] Resolving org.scala-lang#scala-library;2.11.8 ...
    [error] Server access Error: Received fatal alert: access_denied url=https://rep
    o.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-library/2.11.8/ivys/iv
    y.xml
    [error] Server access Error: Received fatal alert: access_denied url=https://rep
    o.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-lang/scala-library/2.11.8
    /ivys/ivy.xml

my buld.sbtis as follows:

name := "spark_codebase"

version := "1.0"

scalaVersion := "2.11.8"

I am in need to fix this as soon as possible. Please suggest any solution.Thanks in advance.

Please find the versions of scala, java, sbt:

C:\Users\thathine>javac -version
javac 1.8.0_131

C:\Users\thathine>scala -version
Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL

and sbt version is sbt-0.13.15.


Solution

  • After some struggle, found that this issue is because of our company network used some proxy to give restricted access to employees like a firewall. As i was behind a proxy, Maven would fail to download any dependencies.

    I got the proxy setings from my companie's IT helpdesk. After using them, It worked finally.I am using windows 7.use the following command line options before using sbt for that session,by replacing [your-ProxyServer] and <port-number> with your actual proxy server and port details.

    set JAVA_OPTS=-Dhttp.proxySet=true -Dhttp.proxyHost=[your-ProxyServer] -Dhttp.proxyPort=<port-number> -Dhttps.proxyHost=[your-ProxyServer] -Dhttps.proxyPort=<port-number> -Dftp.proxyHost=[your-ProxyServer] -Dftp.proxyPort=<port-number>
    

    If you are using IDE like IntelliJ or Eclipse: use the same options under -VM parameters while creating/importing the project.