【问题标题】:sbt eclipse error evaluating task scalaoptions errorsbt eclipse 错误评估任务 scalaoptions 错误
【发布时间】:2021-01-03 05:21:12
【问题描述】:

执行 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”时出错:

[错误] 评估任务“更新”时出错:错误

谁能帮我解决这个问题,尤其是哪里出了错?

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 的虚拟操作系统。

【问题讨论】:

  • “当打 sbt eclipse”是什么意思?
  • 我希望我能在各个方面更加详尽。所以,这里虽然点击 sbt eclipse 意味着“在执行 sbt eclipse 命令之后”

标签: eclipse scala sbt


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 2019-08-14
    • 2020-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-27
    • 2019-01-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多