We are using this plugin to generate code from XSD and WSDL’s:
In addition to the normal code generation we need annotations added to the generated sources. I am trying to use the XJC plugin jaxb2-annotate-plugin to accomplish this.
The gradle XJC plugin has some vague documentation for loading XJC plugins here: https://github.com/unbroken-dome/gradle-xjc-plugin#specifying-the-plugin-classpath
Through that doc, some SO posts and other general searching I pieced together this build.gradle:
xjcGenerate task config I am adding
extraArgs = ["-Xannotate"] (this is supposed to activate the jaxb2-annotate-plugin for XJC).
However, no matter what I do I get the error:
Execution failed for task ‘:xjcGenerate’.
com.sun.tools.xjc.BadCommandLineException: unrecognized parameter -Xannotate
I assume the jaxb2-annotate-plugin for XJC isn’t getting loaded. I am wondering if someone has this working in their gradle build and can provide an example?