• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Different Schemas using com.sun.tools.xjc.maven2

 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have mutiple schemas and I want to genereate java classes in different package for each schema using com.sun.tools.xjc.maven2 plugin, anyone knows how to do this?

-P
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay,resolved it with help of God (google ), used annotation in following way ..just incase some one stumbles here to find solution..



since i had 3 xsd, initially i got following error

Multiple <schemaBindings> are defined for the target namespace ""



Reason for this error is cause none of my xsd had explicit name space defined, so all of those were in default namespace..

-P
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Praful,
I also have XSD with default targetNamespace and getting the same error as you.

Would you mind giving me bit more information how did you solve your issue ?

Did you put <xsd:annotation> (as you specified) in each of the schema which had default targetnamespace?

Please advise.
Thanks
Rajesh
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>I also have XSD with default targetNamespace...
"defaut targetNamespace"? There is no such term as default targetNamespace. If you mean there isn't targetNamespace attribute in the schema, it means only the instance element is not namespace-qualified. The instance element may well be in null namespace, but in the realm of schema language construction, things can still be influenced by the elementFormDefault or attributeFormDefault setting...

If your schema defining the null namespace vocabulary is dispersed throughout different files, you should have xs:include element(s) in some of them. If the one having the xs:include capable of tracing out the complete schema therefrom, you can choose that as your selected (targetted) xsd, and you can put the annotation there, or preferrably make out an jxb file with jxb:bindings node attribute pointing to /xs:schema and schemaLocation attribute pointing to that particular xsd. Like this.

But definitely not in every one of your xsd files!!!
 
reply
    Bookmark Topic Watch Topic
  • New Topic