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!
精彩评论