How does one change the source directory in the sb

2019-08-02 18:49发布

Per the docs, the default location is: src/main/resources.

My XSD's are in src/main/schema, so I need to change the sources setting.

So I have used the following:

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

This results in:

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

标签: sbt xjc
1条回答
爷、活的狠高调
2楼-- · 2019-08-02 18:56
sources in (Compile, xjc) <<= sourceDirectory map (_ / "main" / "schema" ** "*.xsd" get)

docs have been updated.

查看更多
登录 后发表回答