I got a problem when using maven-jaxb2-plugin to generate source code from
xsd. I have a xs:choice in my xsd file and I specific serializable in my
globalbindings. But when maven plugin generate code, some times the
xs:choice element is unmarshel to List<Serializable> and some times the
xs:choice element is unmarshel to List.
My plugin in the pom.xml is like this:
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.6.1</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>src/main/resources/wsdl</schemaDirectory>
<schemaIncludes>
<include>adi2msg.xsd</include>
</schemaIncludes>
<bindingDirectory>src/main/resources/bindings</bindingDirectory>
<bindingIncludes>
<include>xsd-binding.xml</include>
</bindingIncludes>
</configuration>
</plugin>
adi2msg.xsd file is like this:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="
http://userstory/2006-05-05/try2"
xmlns:xs="
http://www.w3.org/2001/XMLSchema"
targetNamespace="
http://userstory/2006-05-05/try2"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="ContentAssetType">
<xs:attribute name="type" type="xs:string" use="required" />
</xs:complexType>
<xs:complexType name="MetadataAssetType">
<xs:attribute name="type" type="xs:string" use="required" />
</xs:complexType>
<xs:element name="ADI2">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="ReplaceMetadataAsset"/>
<xs:element ref="DestroyContentAsset" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ReplaceMetadataAsset" type="MetadataAssetType" />
<xs:element name="DestroyContentAsset" type="ContentAssetType" />
</xs:schema>
xsd-binding.xml file is like this:
<?xml version="1.0" encoding="UTF-8"?>
<jxb:bindings version="1.0" xmlns:jxb="
http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema">
<jxb:globalBindings>
<jxb:serializable uid="1"/>
</jxb:globalBindings>
</jxb:bindings>
When I using the plugin to generate code, some times the type of attribute
replaceMetadataAssetOrDestroyContentAsset in ADI2.java is
List<Serializable>, but some times is List.
Why it is unstable when generating code?
Please help me, thanks!
--
View this message in context: http://old.nabble.com/Unstable-when-generating--List%3CSerializable%3E-tp27846392p27846392.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.