1

根据文档,默认位置是:src/main/resources。

我的 XSD 在 src/main/schema 中,所以我需要更改源设置。

所以我使用了以下内容:

sources in (xjc, Compile)  <+= sourceDirectory / "main" / "schema"

这导致:

overloaded method value in with alternatives:
[error]   (p: sbt.Reference,t: sbt.Scoped)sbt.ScopedTask[Seq[java.io.File]] <and>
[error]   (p: sbt.Reference,c: sbt.ConfigKey)sbt.ScopedTask[Seq[java.io.File]] <and>
[error]   (c: sbt.ConfigKey,t: sbt.Scoped)sbt.ScopedTask[Seq[java.io.File]]
[error]  cannot be applied to (sbt.TaskKey[Seq[java.io.File]], sbt.Configuration)
[error] Error occurred in an application involving default arguments.
[error]       sources in (xjc, Compile) <+= sourceDirectory / "main" / "schema"
[error]               ^
[error] one error found
4

1 回答 1

1
sources in (Compile, xjc) <<= sourceDirectory map (_ / "main" / "schema" ** "*.xsd" get)

文档已更新。

于 2011-11-15T21:04:20.337 回答