java - Maven - xmlbeans : working with multiple schema files to generate a single jar file -


i have different service schema files(more 5), wanted generate jar file using xmlbeans.

i using xmlbean plugin follows

<plugins>     <plugin>         <groupid>org.codehaus.mojo</groupid>         <artifactid>xmlbeans-maven-plugin</artifactid>         <version>${xmlbeans.version}</version>         <executions>             <execution>                 <goals>                     <goal>xmlbeans</goal>                 </goals>                 <phase>compile</phase>             </execution>         </executions>         <inherited>true</inherited>         <configuration>             <download>true</download>             <javasource>${java.version}</javasource>             <schemadirectory>src/main/xsd</schemadirectory>             <xmlconfigs>                 <xmlconfig implementation="java.io.file">src/main/xsdconfig/xsdconfig.xml</xmlconfig>             </xmlconfigs>         </configuration>     </plugin> </plugins> 

i want have different package name different service schema. how specify , provide schema path , xsdconfig file apply package details.

please advice.

you need define file ending in .xsdconfig (e.g. myconfig.xsdconfig) map targetnamespace in each of schema files java package name. put .xsdconfig file in same directory corresponding .xsd file compiling. suppose example have following .xsd file:

<?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema"        targetnamespace="http://your.company.org/dileep">     ... </xs:schema> 

then define following myconfig.xsdconfig files follows:

<!-- must use http://www.bea.com/2002/09/xbean/config namespace here --> <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">     <xb:namespace uri="http://your.company.org/dileep">   <!-- map namespace -->         <xb:package>org.company.your.dileep</xb:package>  <!-- java package -->     </xb:namespace>     <!-- more namespace mappings can go here ... --> </xb:config> 

it possible control names of java classes generated each of schema files.

you can read more in official xmlbeans documentation.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -