-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to specify the FQCN of the XJC Ant task #24
Comments
Hi @henning-meinhardt thanks for the note and for using the plugin! It isn't as simple as just adjusting the FQCN of the XJC ant task. The I'm not familiar with the jvnet Let me do some research & think about it a bit. |
Hi, thanks for quick reply. For me, it did the job. I just added a parameter to set the FQCN and added the required dependencies to "xjr". The contract of the XJC task is compatible (maybe there are some edge cases, but commonly used params work exactly the same). I'm using the following:
As you can see there are quite some plugins involved, all of them working just as expected. Or course it does not make sense to support each and every implementation, but i think the one mentioned is by far the most commonly used because most modern plugins are only compatible to this implementation but not the default one. For details see first answer to this issue: https://stackoverflow.com/questions/50669567/unrecognized-parameter-xsomeplugin-error-when-using-jaxb-xjc-plugins |
Thanks for the detail! I will take a look over the next few days and see what I can do! One thing - you shouldn't need to set |
Hi @henning-meinhardt I've published version 1.6 of this plugin which contains this capability. Please read the README for details on how to use it. TL;DR; You can see an example in src/intTest/resources/com/github/edeandrea/xjcplugin/plugin/XjcPluginIntegrationTests/build.gradle |
Hi Eric, wow, thanks a lot for fixing this within the same day! checked it out and can confirm it's working perfectly! kind regards |
You're welcome! Glad it's working! You caught me on a day I had a few free cycles! |
It would be nice to have the FQCN of the XJC Ant task to be adjustable. Currently the plugin is hard wired to "com.sun.tools.xjc.XJCTask". I'd like to switch to "org.jvnet.jaxb2_commons.xjc.XJC2Task" instead to allow using modern plugins.
The plugin's task has a variable to check for already definied Ant task, preventing re-definition. But imho this is broken as the variable is never properly initialized. If that would work as expected I'd be able to define the XJC Ant task upfront and could adjust the FQCN on my own.
Anyway, a better approach seems to be adding a new property to the extension:
xjcGeneration {
xjcTaskClass = "org.jvnet.jaxb2_commons.xjc.XJC2Task"
schemas { ... }
}
Kind regards
Henning
The text was updated successfully, but these errors were encountered: