加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

scala – 如何解决sbt中的非jar(dll / jnilib)库依赖项?

发布时间:2020-12-16 18:04:36 所属栏目:安全 来源:网络整理
导读:在SBT build.sbt项目文件中,是否可以检索未捆绑为jar的库依赖项? 在我的情况下,我试图使用QTSampledSP,它需要.dll和.jnilib库. 解决方法 要下载工件,您需要让Ivy(以及因此sbt)明确地知道DLL工件.将以下内容添加到项目中的build.sbt. lazy val QtSampledJniL
在SBT build.sbt项目文件中,是否可以检索未捆绑为jar的库依赖项?

在我的情况下,我试图使用QTSampledSP,它需要.dll和.jnilib库.

解决方法

要下载工件,您需要让Ivy(以及因此sbt)明确地知道DLL工件.将以下内容添加到项目中的build.sbt.

lazy val QtSampledJniLibArt = Artifact("qtsampledsp-osx","jnilib","jnilib")

libraryDependencies += "com.tagtraum" % "qtsampledsp-osx" % "0.9.6" artifacts(QtSampledJniLibArt)

resolvers += "beatunes" at "http://www.beatunes.com/repo/maven2"

然后你需要告诉sbt注意这些工件(再次build.sbt):

classpathTypes ++= Set("jnilib","dll")

默认情况下,sbt只会在类路径中添加几种类型(并且jnilib和dll不在其中).

[sbt-0-13-1]> help classpathTypes
Artifact types that are included on the classpath.
[sbt-0-13-1]> show classpathTypes
[info] Set(eclipse-plugin,bundle,hk2-jar,orbit,jar)

由于类路径上需要这些DLL / jnilib才能正确运行,因此您在其中添加其他类型的上述设置classpathType将更正如下所示(在sbt控制台中不要忘记重新加载).

[sbt-0-13-1]> show classpathTypes
[info] Set(eclipse-plugin,jnilib,jar,dll)

如果您需要查看这些文件的更多详细信息,请查看更新报告(来自更新任务),您可以在其中检查所有配置/模块/工件.在sbt控制台中运行show update并查看target / resolution-cache / reports中的文件.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读