sbt未解决的库依赖项

时间:2018-12-29 23:23:38

标签: scala sbt

sbt编译问题未解决的依赖项错误

研究SBT配置。我确实有正确的语法。但是SBT仍然会发出错误消息

name := "MyProject"

version := "1.0"

scalaVersion := "2.11.12"

resolvers += 
  "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/releases"

libraryDependencies += "java.io.IOException" % "IOException" % "latest.integration"

libraryDependencies += "java.io.FileReader" % "FileReader" % "latest.integration"

libraryDependencies += "java.io.FileNotFoundExceptiom" % "FileNotFoundException" % "latest.integration"

我有一个有效的Scala程序。我希望包含依赖项,而不是收到以下警告。我想念什么? 警告消息

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: java.io.IOException#IOException;latest.integration: not found
[warn]  :: java.io.FileReader#FileReader;latest.integration: not found
[warn]  :: java.io.FileNotFoundExceptiom#FileNotFoundException;latest.integration: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

1 个答案:

答案 0 :(得分:1)

嗯,有些奇怪。

通常,您以确实包含一组类而非单个类本身的lib / jar形式声明依赖项。

在您的特定情况下,您甚至不需要添加任何依赖来获取java.io. *类,因为它属于标准库,并且默认情况下已包含