I'm using the org.jvnet.jaxb2.maven2:maven-jaxb2-plugin
in version 0.12.3,
and I have the following problem.
I generate a java files from an xsd files.
I commit and push it on our git repository.
I launch the same generation again (we use
removeOldOutput
option).For some file, git is detecting some changes, because the order of some annotations is not the same between 2 generations.
A part of the first generation:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Software", propOrder = {
"rest"
})
public abstract class Software
extends SoftwareResource
implements Serializable
{
private final static long serialVersionUID = 1L;
@XmlElementRefs({
@XmlElementRef(name = "resource", type = JAXBElement.class),
@XmlElementRef(name = "software", type = JAXBElement.class),
@XmlElementRef(name = "swapSpaceUsedCurrent", type = JAXBElement.class),
@XmlElementRef(name = "isUTCTime", type = JAXBElement.class),
@XmlElementRef(name = "lastStartTime", type = JAXBElement.class),
@XmlElementRef(name = "serialNumber", type = JAXBElement.class),
@XmlElementRef(name = "numberProcessesActiveCurrent", type = JAXBElement.class),
@XmlElementRef(name = "pagingFileSizeCurrent", type = JAXBElement.class),
@XmlElementRef(name = "processMemorySizeCurrent", type = JAXBElement.class),
@XmlElementRef(name = "numUsersCurrent", type = JAXBElement.class)
})
protected List<JAXBElement<? extends Serializable>> rest;
/**
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link Resource }{@code >}
* {@link JAXBElement }{@code <}{@link BigInteger }{@code >}
* {@link JAXBElement }{@code <}{@link Software }{@code >}
* {@link JAXBElement }{@code <}{@link Boolean }{@code >}
* {@link JAXBElement }{@code <}{@link String }{@code >}
* {@link JAXBElement }{@code <}{@link BigInteger }{@code >}
* {@link JAXBElement }{@code <}{@link String }{@code >}
* {@link JAXBElement }{@code <}{@link Quantity }{@code >}
* {@link JAXBElement }{@code <}{@link BigInteger }{@code >}
* {@link JAXBElement }{@code <}{@link Quantity }{@code >}
*
*
*/
public List<JAXBElement<? extends Serializable>> getRest() {
if (rest == null) {
rest = new ArrayList<JAXBElement<? extends Serializable>>();
}
return this.rest;
}
}
The same part of the second generation:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Software", propOrder = {
"rest"
})
public abstract class Software
extends SoftwareResource
implements Serializable
{
private final static long serialVersionUID = 1L;
@XmlElementRefs({
@XmlElementRef(name = "numUsersCurrent", type = JAXBElement.class),
@XmlElementRef(name = "serialNumber", type = JAXBElement.class),
@XmlElementRef(name = "processMemorySizeCurrent", type = JAXBElement.class),
@XmlElementRef(name = "swapSpaceUsedCurrent", type = JAXBElement.class),
@XmlElementRef(name = "pagingFileSizeCurrent", type = JAXBElement.class),
@XmlElementRef(name = "lastStartTime", type = JAXBElement.class),
@XmlElementRef(name = "numberProcessesActiveCurrent", type = JAXBElement.class),
@XmlElementRef(name = "resource", type = JAXBElement.class),
@XmlElementRef(name = "isUTCTime", type = JAXBElement.class),
@XmlElementRef(name = "software", type = JAXBElement.class)
})
protected List<JAXBElement<? extends Serializable>> rest;
/**
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link BigInteger }{@code >}
* {@link JAXBElement }{@code <}{@link String }{@code >}
* {@link JAXBElement }{@code <}{@link Quantity }{@code >}
* {@link JAXBElement }{@code <}{@link String }{@code >}
* {@link JAXBElement }{@code <}{@link Quantity }{@code >}
* {@link JAXBElement }{@code <}{@link BigInteger }{@code >}
* {@link JAXBElement }{@code <}{@link BigInteger }{@code >}
* {@link JAXBElement }{@code <}{@link Boolean }{@code >}
* {@link JAXBElement }{@code <}{@link Resource }{@code >}
* {@link JAXBElement }{@code <}{@link Software }{@code >}
*
*
*/
public List<JAXBElement<? extends Serializable>> getRest() {
if (rest == null) {
rest = new ArrayList<JAXBElement<? extends Serializable>>();
}
return this.rest;
}
}
Why this annotations are ordered differently between 2 generations ? Is there a way to order them ?
Thanks !