sbt从0.13.0迁移到1.3.0

5us2dqdw  于 2021-07-14  发布在  Java
关注(0)|答案(1)|浏览(328)

将sbt从0.13.0迁移到1.3.0时出错。我目前面临的问题是错误:找不到:值scriptclasspath。
迁移后的build.sbt文件。

val main = (project in file(".")).
     settings(
        appName         = "polaris",
        appVersion      = "1.strong text8.8",
        //scriptClasspath := Seq("modules/*", "customer-modules/*")
       // scriptClasspath = Seq[File] = file("modules/*") :: ("customer-modules/*") :: Nil
      **scriptClasspath**~= { cp => cp.+:("modules/*").+:("customer-modules/*") }
    ).dependsOn(
       core, addressbook, pbx, pbxAppSoftphones, pbxAppCallLog, pbxAppQueues, pbxAppPhonebook, pbxAppClick2dial, pbxAppOperator
    ).aggregate(
       core, addressbook, pbx, pbxAppSoftphones, pbxAppCallLog, pbxAppQueues, pbxAppPhonebook, pbxAppClick2dial, pbxAppOperator
    )

我还附上了plugin.sbt文件-

// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
//resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/"

//resolvers += "Maven Central Server" at "https://repo1.maven.org/maven2"

resolvers += Resolver.url("bintray-sbt-plugins", url("http://dl.bintray.com/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.2")

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.6")

迁移时我做错了什么?有个语法错误我搞不清楚。

ekqde3dh

ekqde3dh1#

这是第一个看起来像线索的错误:
错误:value+:不是sbt.io.pathfinder scriptedclasspath的成员~={cp=>“modules/”+:“customer modules/”+:cp}
上面说 scriptedClasspath 是一个 PathFinder 你试图给它添加元素,就好像它是一个 Seq[String] .
阅读有关如何使用路径查找器的文档,并查看scaladoc中的 PathFinder 类型。
很可能你需要调整一下

scriptedClasspath ~= { pathFinder => 
  pathFinder +++
  (baseDirectory.value / "modules") +++ 
  (baseDirectory.value / "customer-modules")
}

相关问题