title: Jibx Maven plugin: how to set Java package in xsd -> Java transform when namespace was defined
body: <p>I use Spring Object-Xml mapping with Jibx to convert some xsd files to Java source files. Jibx is called by jibx-maven-plugin in the build process. My schema files (.xsd) have a namespace "a.b.com" but I want that the generated Java sources are under package "a.com" because the rest of the Java code is organized like that. </p>
  
  <p>I noticed Java packages are determined automatically based on xsd's namespace. Therefore, the question: is it possible to set the java package of output Java source files in xsd->Java transform when using the Jibx Maven plugin when a namespace was defined in the the schema files?</p>
  
  <p>Proposed solutions so far:</p>
  
  <p>1) Use build executions</p>
  
  <p>Proposed below.</p>
  
  <p>Problems:</p>
  
  <ul>
  <li>xsd->Java transform is run every build. I want to manually run it or that is only run when I change xml schemas.</li>
  <li>prefer-inline attribute in customization.xml acts differently with this setup, inlining attributes of an object reference</li>
  </ul>
  
  <p>2) Use customization xml to set Java package</p>
  
  <p>Proposed here: <a href="https://stackoverflow.com/questions/11918691/jibx-codegen-customization-file-package-per-schema">Jibx Codegen: customization file - package per schema</a></p>
  
  <p>Problem: It did not work.</p>
  
  <p>3) modular schema</p>
  
  <p>Proposed here: <a href="https://stackoverflow.com/questions/11909972/jibx-maven-plugin-cross-reference-among-schemas-when-they-are-converted-in-diff">Jibx Maven plugin: cross-reference among schemas when they are converted in different build executions</a></p>
  
  <p>Problem: Too complicated to setup one pom for each schema, generating a jar for each schema and importing the jar in other schemas.</p>
  
  <p>Was anybody successful to solve these issues and was able to set custom Java packages in a xsd->Java conversion when namespace is defined in the xml schemas?</p>
  
  <p>Thanks in advance.</p>