'XJC -jaxb2-maven-plugin-Generated Getter Setter methods does not follow Java conventions

I am working on jaxb2-maven-plugin, I am generating Java POJOs from XSD.

I have an XSD like this

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="employee">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="projects">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" name="project">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="product" type="xs:string" />
                    <xs:element name="id" type="xs:unsignedByte" />
                    <xs:element name="**PRIce**" type="xs:string" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

When I generate the POJOs using the above it generated the getters/setters for field PRIce like this.

public class Project {
  
    @XmlElement(name = "PRIce", required = true)
    protected String prIce;

    public String getPRIce() {
        return prIce;
    }

    public void setPRIce(String value) {
        this.prIce = value;
    }
}

But we need the output like this.

public class Project {
  
    @XmlElement(name = "PRIce", required = true)
    protected String prIce;

    public String getPrIce() {
        return prIce;
    }

    public void setPrIce(String value) {
        this.prIce = value;
    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source