difr:difr 的 sbt 构建方法

difr: how-to sbt build of difr

我想测试 运行 "difr" 实用程序,如下所述:https://github.com/wspringer/difr

但是,我收到以下错误。 您能否就如何解决此问题提出建议?

[info] Done updating.
/home/nskalis/app/difr-master/build.sbt:14: error: not found: value defaultExcludes
defaultExcludes in Compile in unmanagedResources := "*.scaml"
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? i
[warn] Ignoring load failure: no project loaded.
[error] Expected ID character
[error] Not a valid command: build
[error] build.sbt
[error]      ^
[nskalis@app difr-master]$ sbt build.sbt 
[info] Loading project definition from /home/nskalis/app/difr-master/project
/home/nskalis/app/difr-master/build.sbt:14: error: not found: value defaultExcludes
defaultExcludes in Compile in unmanagedResources := "*.scaml"
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? r
[info] Loading project definition from /home/nskalis/app/difr-master/project
/home/nskalis/app/difr-master/build.sbt:14: error: not found: value defaultExcludes
defaultExcludes in Compile in unmanagedResources := "*.scaml"
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? l
[info] Loading project definition from /home/nskalis/app/difr-master/project
[debug] 
[debug] Initial source changes: 
[debug]     removed:Set()
[debug]     added: Set()
[debug]     modified: Set()
[debug] Removed products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set()
[debug] 
[debug] Sources indirectly invalidated by:
[debug]     product: Set()
[debug]     binary dep: Set()
[debug]     external source: Set()
[debug] All initially invalidated sources: Set()
[debug] Copy resource mappings: 
[debug]     
[debug] [Loading] Scanning directory /home/nskalis/app/difr-master
[error] Type error in expression
[debug] > load-failed
[debug] > last

你做的不是运行ning difr,而是building difr。我不确定这是否是您想要的——如果不是,请按照那里的说明进行操作,这些说明与克隆存储库和构建完全无关。

现在,您正在构建的问题是该项目有些旧,因为它已经有一段时间没有更新了。如果您使用的是最新的 SBT 版本,它将不起作用。项目应该使用属性来指示哪个 SBT 版本适用于它,但它没有。

幸运的是,自己很容易做到这一点。只需这样做:

echo 'sbt.version=0.12.4' >project/build.properties

只要您使用的 SBT 版本比该版本更新,它就会相应地下载较旧的 SBT 和 运行。

哦,一定要用Java 1.7 -- Java 1.8 不行。

一旦你准备好了所有这些——build.properties 文件和 Java 1.7——并执行了你想要的更改,运行 这个命令:

sbt assembly

这将生成一个名为 target/scala-2.9.2/difr.jar 的文件,其中包含您的更改,然后您可以按照 difr.github 页面中的说明使用该文件。