How does one change the source directory in the sbt-xjc plugin for SBT?

好久不见. 提交于 2019-12-11 07:13:23

问题


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

回答1:


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

docs have been updated.



来源:https://stackoverflow.com/questions/8052651/how-does-one-change-the-source-directory-in-the-sbt-xjc-plugin-for-sbt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!