sbt eclipse 错误评估任务 scalaoptions 错误

sbt eclipse error evaluating task scalaoptions error

执行 sbt 插件 eclipse 项目构建时出现以下错误。 命令是:sbt eclipse 使用插件文件维护 scala 版本 2.12,如下行:(./home/user/.sbt/0.13/plugins.sbt)

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.4.0")

并且在点击 sbt eclipse 时到达控制台的输出是:

[错误] 评估任务时出错 'scalacOptions'。

[错误] 评估任务时出错 'externalDependencyClasspath':

[错误] 评估任务时出错 'update':错误

任何人都可以帮我解决这个问题,特别是错误在哪里?

project/build.sbt如下:

lazy val root = ( project in file(".") ).
settings(
name := "App_Server",
version := "0.0.0.1-SNAPSHOT",
scalaVersion := "2.12.2",
packageOptions := Seq(ManifestAttributes(
                  ("Implementation-Version", "1.00." + new Timestamp(new Date().getTime)),
                  ("Implementation-Title", "App_Server")))
) dependsOn( locSer ) dependsOn( jobSer ) dependsOn(admin) dependsOn(api) dependsOn(chat) dependsOn(payment) dependsOn(external)

//excludedJars in assembly <<= (fullClasspath in assembly) map { cp =>
//cp filter {x => x.data.getName.matches("slf4j-log4j12-1.7.0.jar") || x.data.getName.matches("slf4j-log4j12-1.4.3.jar")}
//}

assemblyMergeStrategy in assembly := {
case x if Assembly.isConfigFile(x) => MergeStrategy.concat 
case PathList(ps @ _*) if Assembly.isReadme(ps.last) || 
Assembly.isLicenseFile(ps.last) => MergeStrategy.rename
 case PathList("com","google","gson", xs @ _*) => MergeStrategy.first
 case PathList("org","apache","commons","logging", xs @ _*) => 
MergeStrategy.first 
//(xs map {_.toLowerCase}) match {
// case ("google"::"gson"::"exclusionstrategy.class" :: Nil) | ("google"::"gson"::"fieldattributes.class" :: Nil) | ("google"::"gson"::"fieldnamingpolicy.class" :: Nil)  => MergeStrategy.discard
     //case _ => MergeStrategy.deduplicate
//  } 
 case PathList("META-INF", xs @ _*) =>
    (xs map {_.toLowerCase}) match { 
    case  ("maven"::"commons-logging"::"commons-logging"::"pom.properties" :: Nil) | ("maven"::"commons-logging"::"commons-logging"::"pom.xml" :: Nil) => 
MergeStrategy.discard
    case ("manifest.mf" :: Nil) | ("index.list" :: Nil) | ("dependencies" :: Nil)=> MergeStrategy.discard
    case ps @ (x :: xs) if ps.last.endsWith(".sf") || ps.last.endsWith(".dsa") =>MergeStrategy.discard
    case "plexus" :: xs =>MergeStrategy.discard
    case "services" :: xs =>          MergeStrategy.filterDistinctLines
    case ("spring.schemas" :: Nil) | ("spring.handlers" :: Nil) =>          MergeStrategy.filterDistinctLines
    case _ => MergeStrategy.deduplicate
 }
 case _ =>       MergeStrategy.deduplicate
}

像这样

编辑:为了方便,我在 Windows 系统中为 Linux 使用了虚拟 OS。

除非您找到连接虚拟机和实际 PC 的方法,否则您可能无法获得解决方案。 查看虚拟机中的网络设置并检查互联网是否适用于该虚拟机。这可能对您有所帮助!

也尝试删除 .ivy 文件夹> 运行 sbt 再次