SBT Eclipse 应该生成一个项目文件,所有内容都正确设置。您确实需要在任何构建文件更改后运行“sbt update”,然后重新生成 eclipse 项目文件。我怀疑这可能是你的问题。
它应该生成两个文件,.project
并且.classpath
,如下所示:
<projectDescription>
<name>default-0d85ea</name>
<buildSpec>
<buildCommand>
<name>org.scala-ide.sdt.core.scalabuilder</name>
</buildCommand>
</buildSpec>
<natures>
<nature>org.scala-ide.sdt.core.scalanature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
和
<classpath>
<classpathentry output="target/scala-2.9.2/classes" path="src/main/scala" kind="src"></classpathentry>
<classpathentry output="target/scala-2.9.2/classes" path="src/main/java" kind="src"></classpathentry>
<classpathentry output="target/scala-2.9.2/test-classes" path="src/test/scala" kind="src"></classpathentry>
<classpathentry output="target/scala-2.9.2/test-classes" path="src/test/java" kind="src"></classpathentry>
<classpathentry path="org.scala-ide.sdt.launching.SCALA_CONTAINER" kind="con"></classpathentry>
<classpathentry path="/home/dcs/.ivy2/cache/org.scalacheck/scalacheck_2.9.2/jars/scalacheck_2.9.2-1.9.jar" kind="lib"></classpathentry>
<classpathentry path="/home/dcs/.ivy2/cache/org.scala-tools.testing/test-interface/jars/test-interface-0.5.jar" kind="lib"></classpathentry>
<classpathentry path="/home/dcs/.ivy2/cache/org.scala-lang/scala-swing/jars/scala-swing-2.9.2.jar" kind="lib"></classpathentry>
<classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"></classpathentry>
<classpathentry path="bin" kind="output"></classpathentry>
</classpath>
请注意后一个文件中的src/main/scala
和src/main/java
作为src
条目添加。