jaxb-lombok-plugin
jaxb-lombok-plugin copied to clipboard
How does this work?
I'm new to XML and XSD and I need to use XJC to generate ~70 JAXB classes. But all these classes later on will be a pain to maintain if I'm to use setters, so I really need to add Lombok's @Builder
for my own mental sanity's sake.
I don't understand how to use this plugin with xjc command. Your README.md file makes it look like there are two options:
- Create a project and import this plugin with maven, so you can build Java code that will generate the JAXB files with Lombok annotation
- Nothing extra needs to be downloaded. Just add these parameters to your command line call
I'm not willing to create a tool, so I went the command line approach, but xjc seems not to understand the parameters. This is what I typed in (added a few more annotations I feel like I need):
PS C:\Java\jdk1.8.0_201\bin> .\xjc C:\xsd\xsdFile.xsd -d C:\xml -Xlombok -Xlombok:AllArgsConstructor -Xlombok:NoArgsConstructor -Xlombok:Builder -Xlombok:Data
To what it replied with:
unrecognized parameter -Xlombok
And gave me a list of parameters I could use. One of them -extension
, which I tried and also didn't work.
Thanks