请考虑一下,如果有非常愚蠢的东西,我错过了,我是非常新的。
在Eclipse (Scala)上创建这示例。创建CorrelationJobTest.scala类时,从specs2包导入类存在问题。
import org.specs2.runner.JUnitRunner我所犯的错误很明显,
object specs2 is not a member of package org即使在创建build.sbt文件、添加依赖项和执行sbt clean之后,错误仍然会显示出来。下面是我的build.sbt
name := "SparkCorrelation"
organization := "com.xyz"
version := "0.1"
/* scala versions and options */
scalaVersion := "2.10.4"
// These options will be used for *all* versions.
javacOptions ++= Seq("-Xlint:unchecked", "-Xlint:deprecation")
scalacOptions ++= Seq("-feature", "-unchecked", "-deprecation")
/* dependencies */
libraryDependencies ++= Seq("org.specs2" %% "specs2-core" % "3.7" % "test")
scalacOptions in Test ++= Seq("-Yrangepos")编辑:我在apache.spark包中也遇到了这个问题。然后我加入了jar spark-assembly-1.6.0-hadoop-2.6.0.jar,它被解决了。我不是可以在Eclipse中导入一个specs2库吗?
发布于 2016-01-19 11:33:59
开始起作用了。我所做的是:
sbt eclipsebuild.sbt中添加依赖项sbt clean问题是该项目是在eclipse中直接创建的,无法链接到sbt构建文件。
发布于 2016-01-19 07:35:13
您需要将junit模块添加到依赖项中。
libraryDependencies ++= Seq(
"org.specs2" %% "specs2-core" % "3.7" % "test",
"org.specs2" %% "specs2-junit" % "3.7" % "test")https://stackoverflow.com/questions/34870844
复制相似问题