1

I want to create a RESTful Web service with Scala so I recovered a project but when I try to execute the sbt command to run the application, I got an error message and I don't understand why.

[error] sbt.librarymanagement.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;1.5.0-SNAPSHOT: Resolution failed several times for dependency: com.github.mpeltonen#sbt-idea;1.5.0-SNAPSHOT {compile=[default(compile)]}::    
[error]         typesafe-ivy-releases: unable to get resource for com.github.mpeltonen#sbt-idea;1.5.0-SNAPSHOT: res=https://repo.typesafe.com/typesafe/ivy-releases/com.github.mpeltonen/sbt-idea/scala_2.12/sbt_1.0/1.5.0-SNAPSHOT/ivys/ivy.xml: java.io.IOException: Unexpected response code for CONNECT: 404    
[error]         sbt-plugin-releases: unable to get resource for com.github.mpeltonen#sbt-idea;1.5.0-SNAPSHOT: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.github.mpeltonen/sbt-idea/scala_2.12/sbt_1.0/1.5.0-SNAPSHOT/ivys/ivy.xml: java.io.IOException: Unexpected response code for CONNECT: 404    
[error]         public: unable to get resource for com/github/mpeltonen#sbt-idea;1.5.0-SNAPSHOT: res=https://repo1.maven.org/maven2/com/github/mpeltonen/sbt-idea_2.12_1.0/1.5.0-SNAPSHOT/sbt-idea-1.5.0-SNAPSHOT.pom: java.io.IOException: Unexpected response code for CONNECT: 404    
[error]         Sonatype snapshots: unable to get resource for com/github/mpeltonen#sbt-idea;1.5.0-SNAPSHOT: res=http://oss.sonatype.org/content/repositories/snapshots/com/github/mpeltonen/sbt-idea_2.12_1.0/1.5.0-SNAPSHOT/sbt-idea-1.5.0-SNAPSHOT.pom: java.io.IOException: unexpected end of stream on Connection{oss.sonatype.org:80, proxy=HTTP @ 192.168.41.5:80 hostAddress=/192.168.41.5:80 cipherSuite=none protocol=http/1.1}    
[error]         Sonatype releases: unable to get resource for com/github/mpeltonen#sbt-idea;1.5.0-SNAPSHOT: res=https://oss.sonatype.org/content/repositories/releases/com/github/mpeltonen/sbt-idea_2.12_1.0/1.5.0-SNAPSHOT/sbt-idea-1.5.0-SNAPSHOT.pom: java.io.IOException: Unexpected response code for CONNECT: 404    
[error] unresolved dependency: com.eed3si9n#sbt-assembly;0.9.0: Resolution failed several times for dependency: com.eed3si9n#sbt-assembly;0.9.0 {compile=[default(compile)]}::    
[error]         typesafe-ivy-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.9.0: res=https://repo.typesafe.com/typesafe/ivy-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.9.0/ivys/ivy.xml: java.io.IOException: Unexpected response codefor CONNECT: 404
[error]         sbt-plugin-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.9.0: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.9.0/ivys/ivy.xml: java.io.IOException: Unexpected response code for CONNECT: 404    
[error]         public: unable to get resource for com/eed3si9n#sbt-assembly;0.9.0: res=https://repo1.maven.org/maven2/com/eed3si9n/sbt-assembly_2.12_1.0/0.9.0/sbt-assembly-0.9.0.pom: java.io.IOException: Unexpected response code for CONNECT: 404
stefanobaghino
  • 11,253
  • 4
  • 35
  • 63
F.M
  • 11
  • 2
  • It looks like you have trouble connecting to the Ivy2 repository for your dependencies. Are you behind a proxy? If so, you may want to have a look here: https://stackoverflow.com/questions/13803459/how-to-use-sbt-from-behind-proxy – stefanobaghino Jul 10 '18 at 12:04
  • Unfortunately, I already refer the parameters of the proxy in IntelijIDEA and in my environment variables but it doesn't change anything. – F.M Jul 10 '18 at 12:13
  • Can you check if there is some difference between the `project/build.properties` in the remote repository and your local one? If so, you may want to try to set `sbt.version=0.13.15` in that file to pin the SBT version. SBT moved from Scala 2.10 to Scala 2.12 after the 1.0 was published and this means that plugins that were published to work on older version will not work on newer ones. – stefanobaghino Jul 10 '18 at 12:19
  • If you downloaded SBT 1.x to start working in Scala and `project/build.properties` is not there, it's gonna be filled up with the locally available version of SBT, which can lead to this incompatibility issue. – stefanobaghino Jul 10 '18 at 12:20
  • I had a further look at your dependencies, it looks like you're using a very old piece of software as your starting point and not even reverting to a older version of SBT will probably work. I would suggest you try to rewrite the build file trying to locate the most up-to-date resolvers and versions, otherwise it can be tricky. – stefanobaghino Jul 10 '18 at 12:23
  • Thanks a lot, I will rewrite the project. It is clearer in my head. – F.M Jul 10 '18 at 12:40

0 Answers0