【发布时间】:2017-04-27 13:09:05
【问题描述】:
我正在尝试将 @javax.annotation.Generated 注释添加到我的所有由 JAXB 从 XSD 生成的类中。
我正在使用 maven-jaxb2-plugin 和一个 binding.xjb 文件来生成源代码。我看到 JAXB 插件 jaxb2-basics-annotate 应该可以解决问题。但我能找到的只是为特定类添加注释的示例。喜欢这个:
<jaxb:bindings schemaLocation="csw/2.0.2/CSW-discovery.xsd" node="/xs:schema">
<jaxb:bindings node="xs:complexType[@name='GetRecordsType']">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="GetRecordsType" />
</annox:annotate>
</jaxb:bindings>
如何为每个生成的文件执行此操作?这可能吗?
【问题讨论】:
标签: java maven jaxb annotations