I did find How do you customize how JAXB generates plural method names? , but the question is over 10 years old now and since I had to change my binding to Jakarta the accepted answer doesn't work for me anymore. (Altho I'm not really familiar with jaxb so perhaps I'm wrong)
So after upgrading my jaxb2-maven-plugin version I got an error on the binding file:
not an external binding file. The root element must be {https://jakarta.ee/xml/ns/jaxb}bindings but it is {http://java.sun.com/xml/ns/jaxb}bindings
After googling and some trial and error I managed to get the generation working again with the following binding file
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb"
xmlns:xjc="https://jakarta.ee/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="3.0">
<jaxb:globalBindings>
<jaxb:javaType name="java.util.Calendar"
parseMethod="jakarta.xml.bind.DatatypeConverter.parseDateTime"
printMethod="jakarta.xml.bind.DatatypeConverter.printDateTime"
xmlType="xs:dateTime"/>
<xjc:serializable uid="-1"/>
</jaxb:globalBindings>
</jaxb:bindings>
However, with the java.sun.com bindings collections used to be generated in plural form. With jakarta it seems to be in the singular form. For Example: With sun.com binding collections used to be generated as:
@XmlElement(name = "Strd")
protected List<GeneratedObject> strds;
And with jakarta:
@XmlElement(name = "Strd")
protected List<StructuredRemittanceInformation7> strd;
While changing the references to these fields won't take too much time (I only use the generated object once to map to a dto), I'm still quite curious how I could achieve generating collections with plural forms.