【问题标题】:SBT dependency on non-SBT librarySBT 对非 SBT 库的依赖
【发布时间】:2013-08-26 22:01:04
【问题描述】:

我的 Play/SBT 项目需要依赖以源代码形式分发的第三方 Java 库,并且可以使用 Ant 或 Maven 构建。它的根目录包含pom.xmlbuild.xml

我正在考虑将此库添加为 git 子模块,并让 SBT 将其构建为子项目。我尝试添加

externalPom(baseDirectory(_ / "pathToLibrary" / "pom.xml"))

我的构建设置,但我最终得到以下编译器错误:

[info] Compiling 32 Scala sources and 5 Java sources to /home/thesamet/project]
[error] (compile:compile) scala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found.
[error] Total time: 1 s, completed Aug 23, 2013 11:46:20 AM

【问题讨论】:

    标签: maven sbt


    【解决方案1】:

    外部pom只能获取maven项目的library dependencies,不能编译。

    您可以为外部项目添加 sbt 构建配置或更简单,您可以将第三方模块发布到企业 Maven 或 Ivy 存储库,或者使用 mvn install 将第三方模块发布到本地并将 ~/.m2 添加为 file resolver 到您的 SBT 项目。

    【讨论】:

      猜你喜欢
      • 2015-08-26
      • 2015-05-24
      • 2013-07-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-18
      • 1970-01-01
      • 2018-03-20
      相关资源
      最近更新 更多