Do you mean 1.1 of the plugin or the castor.jar?
also, maven does not seem to know anything other than v1.0 in
org.codehaus.mojo.
Xavier
Werner Guttmann wrote:
>
> No, it's not. But part of that logic has been improved when working
> towards 1.1. I'd suggest you switch to 1.1 final, and use the
> /complexType: prefix.
>
> Werner
>
> Xavier Naud wrote:
>>
>> That works nicely.
>> so the <elementBinding name="/complexType:XXX> is "deprecated". I missed
>> that in the doc.
>>
>> Thanks a lot
>>
>> Xavier
>>
>>
>>
>> Werner Guttmann wrote:
>>> The one you are using is the correct one. For the complex type binding,
>>> can you please try ...
>>>
>>> <complexTypeBinding name="Airport">
>>> ...
>>> </complexTypeBinding>
>>>
>>> and see whether this works.
>>>
>>> Werner
>>>
>>> Xavier Naud wrote:
>>>> As suggested, I added an element binding for one of my global element
>>>> of
>>>> the
>>>> schema.
>>>> the element binding is correctly handled (and my element class is
>>>> renamed).
>>>> However, nothing is happening with my complex type binding...
>>>>
>>>> by the way, what is the right maven plugin? I found 2:
>>>> - org.codehaus.mojo : castor-maven-plugin, 1.0 (the one I am using)
>>>> - maven: maven-castor-plugin, 1.2 (does not work)
>>>>
>>>> Xavier
>>>>
>>>>
>>>>
>>>>
>>>> Werner Guttmann wrote:
>>>>> Do you have en element declaration in your XML schema ? If yes, can
>>>>> you
>>>>> please try to add an element binding for that element to see whether
>>>>> it's being picked up (or not) ? If that's the case; I guess we have to
>>>>> find out whether 1.1M2 already supported the /complexType: prefix for
>>>>> component bindings or not.
>>>>>
>>>>> Werner
>>>>>
>>>>> Xavier Naud wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I am using maven2 with the castor plugin 1.0 and a dependency on
>>>>>> castor
>>>>>> 1,1M2 to generate some beans from a XSD. my XSD define complex types
>>>>>> and
>>>>>> elements that have the same name. I tried to defined a binding file
>>>>>> to
>>>>>> change the name of the java classes but it does not work.
>>>>>>
>>>>>> below are my maven plugin def + config, the binding file and the
>>>>>> generated
>>>>>> code:
>>>>>>
>>>>>> Plugin:
>>>>>> <plugin>
>>>>>> <groupId>org.codehaus.mojo</groupId>
>>>>>> <artifactId>castor-maven-plugin</artifactId>
>>>>>> <version>1.0</version>
>>>>>> <configuration>
>>>>>> <schema>
>>>>>>
>>>>>> ${basedir}/src/main/castor/FlightHistoryFeedSchema.xsd
>>>>>> </schema>
>>>>>> <packaging>
>>>>>> mypackage.flightstats.data
>>>>>> </packaging>
>>>>>> <bindingfile>
>>>>>>
>>>>>> ${basedir}/src/main/castor/binding.xml
>>>>>> </bindingfile>
>>>>>> <properties>
>>>>>>
>>>>>> ${basedir}/src/main/castor/castorbuilder.properties
>>>>>> </properties>
>>>>>> <verbose>true</verbose>
>>>>>> <warnings>true</warnings>
>>>>>> <types>j2</types>
>>>>>> </configuration>
>>>>>> <executions>
>>>>>> <execution>
>>>>>> <goals>
>>>>>> <goal>generate</goal>
>>>>>> </goals>
>>>>>>
>>>>>> </execution>
>>>>>> </executions>
>>>>>> </plugin>
>>>>>>
>>>>>> extract of my binding file (I tried with and without the / for
>>>>>> complexType):
>>>>>>
>>>>>> <elementBinding name="/complexType:Airline">
>>>>>> <java-class name="AirlineVO">
>>>>>> </elementBinding>
>>>>>>
>>>>>> The XSD:
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>>>> xmlns:ns="http://myNamespace.xsd/mySchema.xsd"
>>>>>> targetNamespace="http://myNamespace.xsd/mySchema.xsd"
>>>>>> elementFormDefault="qualified">
>>>>>> <xsd:complexType name="Airport">
>>>>>> <xsd:attribute name="AirportCode" type="xsd:string"
>>>>>> use="optional" />
>>>>>> <xsd:attribute name="IATACode" type="xsd:string" use="optional"
>>>>>> />
>>>>>> <xsd:attribute name="ICAOCode" type="xsd:string" use="optional"
>>>>>> />
>>>>>> <xsd:attribute name="FAACode" type="xsd:string" use="optional"
>>>>>> />
>>>>>> <xsd:attribute name="Name" type="xsd:string" use="optional" />
>>>>>> </xsd:complexType>
>>>>>> <xsd:complexType name="FlightScheduleEntry">
>>>>>> <xsd:sequence>
>>>>>> <xsd:element name="Airline" type="ns:Airline" />
>>>>>> ...
>>>>>> <xsd:sequence>
>>>>>> <xsd:complexType
>>>>>> </xsd:schema>
>>>>>>
>>>>>>
>>>>>> Generated code:
>>>>>>
>>>>>> public class Airline extends Airline implements java.io.Serializable
>>>>>> { ...
>>>>>> }
>>>>>>
>>>>>> Thanks for helping
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe from this list please visit:
>>>>>
>>>>> http://xircles.codehaus.org/manage_email
>>>>>
>>>>>
>>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list please visit:
>>>
>>> http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
--
View this message in context:
http://www.nabble.com/Binding-file-not-picked-up-with-Maven-for-code-generation-tf3414819.html#a9544092
Sent from the Castor - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email