I am generating POJOs from XSD schemas using the maven-jab2-plugin. My generated classes don’t have setters for any fields that are collections. How do I generate setters for collections?
Can anyone explain the reasoning for setters to not be enabled by default?
Use the Setters plugin included in JAXB2-Basics, as documented here.
I’ve copy-pasted their usage example (and modified it to show setters specifically):
And include the JAXB2 Basics Runtime package in your dependencies: