- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
设想:
| - .git
|
| - projectA
| | - src
| | - build.sbt
|
| - projectB (Git submodule)
| | - src
| | | - build.sbt
| | | - project
| | | - project.sbt
| | | - ...
projectA/build.sbt
试过:
unmanagedBase := baseDirectory.value / ".." / "projectB" / "deploy" / "lib"
lazy val projectB = RootProject(file("../projectB/src/project"))
lazy val projectA = Project(id = "projectA", base = file(".")).settings(
name := "projectA",
version := "0.1",
scalaVersion := "2.12.8",
scalacOptions in ThisBuild ++= Seq("-unchecked", "-deprecation")
).dependsOn(projectB)
projectB/src/build.sbt
使用放入
projectB/deploy/lib
的非托管库在
sbt compile
时找不到在 projectA 范围内运行 - 即使使用
unmanagedBase
属性集。
projectA
中打开 SBT shell compile
并得到[IJ]sbt:projectA> compile
[info] Compiling 13 Scala sources to ...\sbt-multi-project-question\projectB\src\project\target\scala-2.12\classes ...
[error] ...\sbt-multi-project-question\projectB\src\project\File.scala:19:11: object tools is not a member of package scala
[error] scala.tools.nsc.io.File(f.toString).appendAll(strings:_*)
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\Utils.scala:31:14: object Keys is not a member of package sbt
[error] import sbt.Keys.packageBin
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\Utils.scala:33:36: not found: value Def
[error] def deployPackage(name: String): Def.Initialize[Task[Unit]] =
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\Utils.scala:34:5: not found: value packageBin
[error] packageBin in Compile map {jar => deployTo(Utils.deploy / name)(jar)}
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\Utils.scala:34:19: not found: value Compile
[error] packageBin in Compile map {jar => deployTo(Utils.deploy / name)(jar)}
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\Utils.scala:45:39: type File is not a member of package sbt
[error] def deployTo(target: File)(jar: sbt.File): Unit = {
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\Utils.scala:39:36: not found: value Def
[error] def deployMathHub(target: File): Def.Initialize[Task[Unit]] =
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\Utils.scala:40:5: not found: value packageBin
[error] packageBin in Compile map {jar => deployTo(target)(jar)}
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\Utils.scala:40:19: not found: value Compile
[error] packageBin in Compile map {jar => deployTo(target)(jar)}
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\Utils.scala:123:25: not found: type Logger
[error] def delRecursive(log: Logger, path: File): Unit = {
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:8:44: not found: type Project
[error] case class VersionSpecificProject(project: Project, excludes: Exclusions) {
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:13:48: not found: type Project
[error] def aggregate(projects: ProjectReference*) : Project = project.aggregate(excludes(projects.toList) :_*)
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:13:27: not found: type ProjectReference
[error] def aggregate(projects: ProjectReference*) : Project = project.aggregate(excludes(projects.toList) :_*)
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:17:48: not found: type Project
[error] def dependsOn(projects: ProjectReference*) : Project = {
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:17:27: not found: type ProjectReference
[error] def dependsOn(projects: ProjectReference*) : Project = {
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:18:47: not found: type ClasspathDep
[error] def toClassPathDep(p: ProjectReference) : ClasspathDep[ProjectReference] = p
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:18:27: not found: type ProjectReference
[error] def toClassPathDep(p: ProjectReference) : ClasspathDep[ProjectReference] = p
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:23:59: not found: type Project
[error] def aggregatesAndDepends(projects: ProjectReference*) : Project = {
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:23:38: not found: type ProjectReference
[error] def aggregatesAndDepends(projects: ProjectReference*) : Project = {
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:24:47: not found: type ClasspathDep
[error] def toClassPathDep(p: ProjectReference) : ClasspathDep[ProjectReference] = p
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:24:27: not found: type ProjectReference
[error] def toClassPathDep(p: ProjectReference) : ClasspathDep[ProjectReference] = p
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:30:37: not found: type Project
[error] implicit def fromProject(project: Project) : VersionSpecificProject = VersionSpecificProject(project, Exclusions())
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:34:28: not found: type ProjectReference
[error] case class Exclusions(lst: ProjectReference*) {
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:31:61: not found: type Project
[error] implicit def toProject(vProject: VersionSpecificProject): Project = vProject.project
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:35:68: not found: type ProjectReference
[error] private def javaVersion(versions: List[String], exclusions: List[ProjectReference]) : Exclusions = {
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:43:22: not found: type ProjectReference
[error] def :::(lst2: List[ProjectReference]) = Exclusions(lst.toList ::: lst2 : _*)
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:39:25: not found: type ProjectReference
[error] def java7(exclusions: ProjectReference*): Exclusions = javaVersion(List("1.7", "7"), exclusions.toList)
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:40:25: not found: type ProjectReference
[error] def java8(exclusions: ProjectReference*): Exclusions = javaVersion(List("1.8", "8"), exclusions.toList)
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:41:25: not found: type ProjectReference
[error] def java9(exclusions: ProjectReference*): Exclusions = javaVersion(List("1.9", "9"), exclusions.toList)
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:46:18: not found: value ScopeFilter
[error] def toFilter : ScopeFilter.ProjectFilter = {
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:47:5: not found: value inAnyProject
[error] inAnyProject -- inProjects(lst :_*)
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:47:21: not found: value inProjects
[error] inAnyProject -- inProjects(lst :_*)
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:51:28: not found: type ProjectReference
[error] private def equals(left: ProjectReference, right: ProjectReference) : Boolean = {
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:51:53: not found: type ProjectReference
[error] private def equals(left: ProjectReference, right: ProjectReference) : Boolean = {
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:61:25: not found: type ProjectReference
[error] def excludes(project: ProjectReference) : Boolean = lst.exists(equals(_, project))
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:62:54: not found: type ProjectReference
[error] def apply(projects: List[ProjectReference]) : List[ProjectReference] = projects.filterNot(this.excludes)
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:62:28: not found: type ProjectReference
[error] def apply(projects: List[ProjectReference]) : List[ProjectReference] = projects.filterNot(this.excludes)
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:64:17: not found: type ProjectReference
[error] def map[B](f: ProjectReference => B) : Seq[B] = lst.map(f)
[error] ^
[error] ...\sbt-multi-project-question\projectB\src\project\VersionSpecificProject.scala:65:21: not found: type ProjectReference
[error] def foreach[U](f: ProjectReference => U) : Exclusions = {lst.foreach[U](f); this }
[error] ^
[error] 39 errors found
[error] (ProjectRef(uri("file:/.../sbt-multi-project-question/projectB/src/project/"), "project") / Compile / compileIncremental) Compilation failed
[error] Total time: 5 s, completed 04.03.2019, 10:10:34
[IJ]sbt:projectA>
projectB/src
中打开 SBT shell . compile
请注意,在我的机器上大约需要 12 分钟并输出大量警告,但没有错误。 最佳答案
好的 build.sbt
中的这些更改它适用于我的机器:
//unmanagedBase := baseDirectory.value / ".." / "projectB" / "deploy" / "lib"
// this only defines the unmanagedBase of Project A
//lazy val projectB = RootProject(file("../projectB/src/project"))
// see the project setup below
lazy val projectB = RootProject(file("../projectB"))
lazy val projectBmmt = RootProject(file("../projectB/mmt"))
lazy val projectA = Project(id = "projectA", base = file(".")).settings(
name := "projectA",
version := "0.1",
scalaVersion := "2.12.8",
scalacOptions in ThisBuild ++= Seq("-unchecked", "-deprecation"),
// unmanagedBase in ThisBuild := baseDirectory.value / ".." / "projectB" / "deploy" / "lib"
// this only defines the unmanagedBase of Project A
).dependsOn(projectB, projectBmmt)
关于scala - SBT 多项目设置,其中子项目构建文件依赖于非托管 JAR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54980499/
我有兴趣弄清楚 sbt.TaskKey 或 sbt.SettingKey 的一些操作是做什么的 n + "-assembly-" + v + ".jar" } 此时你必须以某种方式知道 jarN
是否可以在 SBT 中注释掉整个文本 block ,类似于 /* Java 样式 block 注释 */ 语法?我遇到了一些构建错误,只能使用多个单行注释。 我看到的构建错误是解析表达式时出错。确保设
我在 Windows 上运行 SBT 1.1.1。 如果我将以下行放在 build.sbt 中,我的构建就可以了: credentials += Credentials(Path.userHome /
Maven 有 optional dependency概念。在 SBT 文档中搜索可选依赖项仅找到 "However, sometimes we have optional dependencies
我有一个 sbt 项目,其中包含大量子项目和外部库依赖项。 build.sbt是这样的: val extlib1 = "xy.xxx" % "lib1" % "1.0+" val extlib2 =
在编译我的 SBT 项目定义(即 project 目录中的文件)时,我收到了弃用和功能警告。 SBT 版本是 0.13.0。 我没有通过设置 scalacOptions := Seq("-featur
根据经验, build.sbt 中声明的库依赖项的顺序似乎很重要。这是真的?如果是这样,值得在 sbt library management 中简要提及。文档的部分。 最佳答案 是的,列出的顺序是用于
我希望我遗漏了一些东西,因为当程序在 sbt 中运行时,按键似乎不会回显到屏幕上。 下面是一个例子: object ConsoleTest extends App { println("Enter
[SBT 文档] 说 Put settings in a .sbt file in a project that isn't checked into version control, such as
这个问题在这里已经有了答案: How to use sbt from behind proxy? (16 个回答) 7年前关闭。 我试图在防火墙后面运行 sbt,但我无法禁用它。但不知何故,我可以获得
我刚刚偶然发现了 sbt-pack插入。开发流好像steady .这让我感到惊讶,因为我认为(引用 sbt-pack 的标题)唯一的插件是“创建可分发的 Scala 包”。是 sbt-assembly
如何配置 sbt 以使用代理? 例如,我的构建定义需要连接到 GitHub,指定 http.proxy、http.proxyPort、user 的连接参数,和密码。 我如何将这些设置传递给 sbt?
我似乎无法找到下面看到的第一次驱逐的根本原因。如下所示,运行 evicted 不会提供与其相关的详细信息。 这一切都是在添加到 project/plugins.sbt 之后发生的:libraryDep
我正在用 sbt 0.11.2 创建一个 Scala 项目和 sbt-idea,我得到了 UNRESOLVED DEPENDENCIES在 gen-idea任务。 我刚刚安装了 sbt(下载了 jar
对于使用 sbt 0.13.5 成功构建的项目(尝试升级到 0.13.6,仍然无法正常工作),我们在构建服务器上突然出现故障(typesafe 和 maven 存储库通过我们的内部 Nexus 存储库
在 unix shell 中试试这个: git clone git@github.com:jsuereth/sbt-in-action-examples.git cd sbt-in-action-ex
我想知道什么时候应该使用sbt assembly,什么时候应该使用sbt compile && sbt package? 我正在使用 Intellij IDEA 在我的本地计算机上编写一个程序,并使用
有没有人使用 sbt-aether-deploy 将 sbt-native-packager 生成的工件(在我的例子中是 tgz)发布到 nexus 仓库? (我需要这个用于带时间戳的快照,特别是 n
我正在尝试在使用 SBT 版本 0.13.5 的项目中启用自定义 AutoPlugin。当我尝试在我的 build.sbt 中启用插件时通过: val aProject = project.in(fi
我正在安装Apache Spark它使用自己的 SBT 副本来进行设置。 我在 VirtualBox 虚拟机中使用 Linux Mint。 以下是我从 Spark 目录 spark-0.9.0-inc
我是一名优秀的程序员,十分优秀!