我在windows
上用sbt
的eclipse
插件生成了了一个项目,并在build.sbt
文件中配置了项目依赖如下:
name := "xxxxx" version := "0.0.1-SNAPSHOT" libraryDependencies += "org.springframework" % "spring-jdbc" % "3.1.0.RELEASE"
之后使用sbt compile
命令想编译了一次,看到依赖的包都下载下来了。然后又使用sbt console
进入了scala EPEL
尝试导入spring
的相关包也都可以,没有问题。
但是在eslipse
里面导入项目之后再尝试import org.springframework._
则提示找不到相关的类。spring jdbc
的相关功能(注解,Datasource
类等等) 都无法使用。。
头疼死,求帮忙!
It feels like there is a missing command. If you are using maven, you need to execute it
sbt I guess there is a similar command
It is recommended to use IDEA, which can directly import sbt projects, just like importing mavne projects.
At the same time, there are also plug-ins such as sbt-idea that can be used.
For Eclipse, you can use the sbteclipse plug-in: https://github.com/typesafehub/sbteclipse
It is recommended to use IntelliJ Idea. Eclipse’s support for Scala is still not as good as Idea.