sbt.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.10: not found

2015-07-07 17:04:53   作者:MangoCool   来源:MangoCool

win7下,sbt项目中执行打包命令:package,出现异常:

[warn] 	module not found: org.scala-lang#scala-library;2.10
[warn] ==== local: tried
[warn]   C:/Users/Administrator/.ivy2/local/org.scala-lang/scala-library/2.10/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10/scala-library-2.10.pom
[info] Resolving org.scala-lang#scala-compiler;2.10 ...
[warn] 	module not found: org.scala-lang#scala-compiler;2.10
[warn] ==== local: tried
[warn]   C:/Users/Administrator/.ivy2/local/org.scala-lang/scala-compiler/2.10/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.10/scala-compiler-2.10.pom
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	::          UNRESOLVED DEPENDENCIES         ::
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	:: org.scala-lang#scala-library;2.10: not found
[warn] 	:: org.scala-lang#scala-compiler;2.10: not found
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.10: not found
unresolved dependency: org.scala-lang#scala-compiler;2.10: not found

我猜大概意思是项目Modules的编译需要的scala-2.10依赖在本地和指定公网地址都没找到。

于是我就直接在build.sbt中添加:

scalaVersion := "2.11.2"

然后直接File->Project Structure->Libraries,点击“+”号选中Scala SDK,然后下载2.11.2版本的:

保险起见重启一下IDEA,启动sbt console 再次执行package命令,问题解决!


如未解决可以参考:https://issues.scala-lang.org/browse/SI-8772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

                              http://stackoverflow.com/questions/14979361/sbt-idea-1-2-0-unresolved-for-sbt-0-12-0-and-scala-2-10-0

标签: SBT Scala exception package command

分享:

关于我

一个喜欢唱歌,热衷旅行,爱好电子产品的码农。没事,跟三五好友吼上几嗓子,约上几个背着行囊去露营或者宅在家里抱着孩子敲代码。

座右铭:当你的才华还撑不起你的野心的时候,你就应该静下心来学习,永不止步!

            人生之旅历途甚长,所争决不在一年半月,万不可因此着急失望,招精神之萎葸。


Copyright 芒果酷(mangocool.com) All rights reserved. 湘ICP备14019394号

免责声明:本网站部分文章转载其他媒体,意在为公众提供免费服务。如有信息侵犯了您的权益,可与本网站联系,本网站将尽快予以撤除。