开发者

JAXB: how to get sources annotated by @generated by ant task?

Is there a way to pass the option -mark-generated, which is applicable to xjc.bat:

%JAXB_HOME%\bin\xjc.bat -mark-generated c:\TEMP\my.xsd

to the corresponding ant task?

<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
   <classpath refid="classpath" />
</taskdef>

<xjc schema开发者_StackOverflow中文版="my.xsd" destdir="src" package="gen.example">
  <produces dir="src/gen" includes="**/*.java" />
</xjc>


You can pass -mark-generated and other options which are not directly supported in an tag nested under the tag, like this:

<xjc schema="simple.xsd" destdir="src" package="gen.example">
  <produces dir="src/gen" includes="**/*.java" />
  <arg line="-mark-generated"/>
</xjc>

See the Ant Task reference for details. Happy marshalling!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜