Reputation:
I am trying to build simple hello world SBT-Scala project using IntelliJ.
When I tried to created the project for the first time, after installing the scala/ SBT plugins, I am getting the following error:
Error:Error while importing SBT project:<br/>...<br/><pre>[info] Resolving org.scala-lang#scala-reflect;2.11.8 ...
[info] Resolving org.scala-lang#scala-reflect;2.11.8 ...
[info] Resolving org.scala-lang.modules#scala-xml_2.11;1.0.4 ...
[info] Resolving org.scala-lang.modules#scala-parser-combinators_2.11;1.0.4 ...
[info] Resolving jline#jline;2.12.1 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-lang#scala-reflect;2.11.8: org.scala-lang#scala-reflect;2.11.8!scala-reflect.pom(pom.original) origin location must be absolute: file:/root/.m2/repository/org/scala-lang/scala-reflect/2.11.8/scala-reflect-2.11.8.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] org.scala-lang:scala-reflect:2.11.8
[warn] +- org.scala-lang:scala-compiler:2.11.8
[warn] +- default:supersimplerootscalasbt3_2.11:1.0
[trace] Stack trace suppressed: run 'last *:ssExtractProject' for the full output.
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[error] (*:ssExtractProject) sbt.ResolveException: unresolved dependency: org.scala-lang#scala-reflect;2.11.8: org.scala-lang#scala-reflect;2.11.8!scala-reflect.pom(pom.original) origin location must be absolute: file:/root/.m2/repository/org/scala-lang/scala-reflect/2.11.8/scala-reflect-2.11.8.pom
[error] (*:update) sbt.ResolveException: unresolved dependency: org.scala-lang#scala-reflect;2.11.8: org.scala-lang#scala-reflect;2.11.8!scala-reflect.pom(pom.original) origin location must be absolute: file:/root/.m2/repository/org/scala-lang/scala-reflect/2.11.8/scala-reflect-2.11.8.pom
[error] Total time: 3 s, completed 22 May, 2017 4:42:05 PM</pre><br/>See complete log in <a href="file:/root/.IdeaIC2017.1/system/log/sbt.last.log">file:/root/.IdeaIC2017.1/system/log/sbt.last.log</a>
Any idea how to solve the origin location must be absolute error in this?
[Kindly note that I am able to find the file scala-reflect-2.11.8.pom unlike the error specifies: file:/root/.m2/repository/org/scala-lang/scala-reflect/2.11.8/scala-reflect-2.11.8.pom]
My build.sbt file:
name := "SuperSimpleRootScalaSBT4"
version := "1.0"
scalaVersion := "2.11.8"
My sbt version is 0.13.15.
Upvotes: 18
Views: 5891
Reputation: 81
Deleting the specific dependency from ~/.ivy2/ worked for me. At times it is not a good idea to remove all dependencies as it takes long time to get them back onto the machine.
Upvotes: 0
Reputation: 93
For me helped when I granted permissions for full Maven repo:
chmod -R 755 /Users/<your_user>/.m2/
Upvotes: 0
Reputation: 21
i was facing the same issue:
instead of of deleting the .ivy folder, just back it up (rename the folder .ivy2 as .ivy2.backup in instance), then test again eg
$ sbt new scala/hello-world.g8
the project should be created and set up correctly now
Upvotes: 1
Reputation: 936
Deleting ~/.ivy2 works, but not the best option, then you have to download all the cache again. Rather delete the particular directory from cache where you are facing issue.
In your case, it should be ~/.ivy2/cache/scala.lang and rebuild
Upvotes: 6