jaxb2-annotate-plugin
jaxb2-annotate-plugin copied to clipboard
Remove all annotations of a certain type
Is it possible to use this plugin to remove all annotations of a certain type off all the generated classes. E.g. I want to ensure the generated source does not include @XmlSchemaType on any fields but don't want to have to do this on each and every field I tried this:
<jaxb:bindings schemaLocation="service.xsd" node="/xs:schema"> <jaxb:bindings node="//xs:element"> <annox:removeAnnotation class="javax.xml.bind.annotation.XmlSchemaType" /> </jaxb:bindings> </jaxb:bindings>
But get an error: lineNumber: 17; columnNumber: 44; XPath evaluation of "//xs:element" results in too many (176) target nodes
You can defined the "not recognized" but existing attribute multiple="true"
to get rid of the message and get the goal you want to do @bcluap (response more for reference, hope you're not waiting for more than 3 years for the fix 😄)