org.codehaus.mojo jaxb2-maven-plugin を使用して、クラスの xsd スキーマを生成しました。プラグイン サイト http://mojo.codehaus.org/jaxb2-maven-plugin/faq.htmlは、プラグインが JDK ユーティリティ schemagen.exe を使用して生成を行うことを伝えます。 問題は、生成された xsd の順序が決定されず、プラグインを実行するマシンに依存することです。
public class One {
public String field1;
}
public class Two {
public String field2;
}
そして生成されたスキーム:
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="two">
<xs:sequence>
<xs:element name="field2" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="one">
<xs:sequence>
<xs:element name="field1" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
しかし、私の同僚が生成を実行すると、別の注文が発生します。
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="one">
<xs:sequence>
<xs:element name="field1" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="two">
<xs:sequence>
<xs:element name="field2" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
を使用しております
- JDK1.6.0_26
- jaxb2-maven-plugin 1.3
- jaxb-impl バージョン 2.1.12 (プラグインで使用)
この順序を制御する方法はありますか?