在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才能正确运行,所以classpathTypes
添加其他类型的上述设置将更正如下所示的内容(不要忘记reload
在sbt控制台中).
[sbt-0-13-1]> show classpathTypes [info] Set(eclipse-plugin, bundle, hk2-jar, jnilib, orbit, jar, dll)
如果您需要查看这些文件的更多详细信息,请查看更新报告(来自update
任务),您可以在其中检查所有配置/模块/工件.show update
在sbt控制台中运行并查看中的文件target/resolution-cache/reports
.