Scala sbt未解析的库依赖项
sbt编译问题未解决的依赖项错误 研究SBT配置。我确实有正确的语法。但SBT仍然存在错误Scala sbt未解析的库依赖项,scala,sbt,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.IOEx
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] ::::::::::::::::::::::::::::::::::::::::::::::
嗯,有点奇怪 通常,您以lib/jar的形式声明依赖项,它确实包含一组类,而不是单个类本身
在您的特定情况下,您甚至不需要添加任何依赖项来获取java.io.*类,因为它属于标准库,默认情况下包含这些类,它们看起来像标准java类。。。您不需要将它们作为依赖项包含,它们始终存在于JRE中。此外,这些依赖项是外部项目(通常以JAR的形式),而不是单个类。如果您在项目中注释/删除该行,它是否按预期工作?或者您在编译时/运行时是否有任何错误?是的。感谢您澄清这些差异。