users@jaxb.java.net

Multiple schema and maven plugin

From: Josyula Jagadeesh <josyulajj_at_yahoo.com>
Date: Tue, 5 Jun 2007 13:44:34 -0700 (PDT)

Hi,

I have two xml schemas, i need to generate the jaxb classes in two different
packages. How can i configure the maven-jaxb2-plugin for this scenario.

Usecase:

PO.xsd - the generated classes should go to org.jaxb.po
Item.xsd - the generated classes should go to org.jaxb.item

The following plugin configuration in my pom.xml which dose not work..

      <plugin>
        <groupId>com.sun.tools.xjc.maven2</groupId>
        <artifactId>maven-jaxb-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <schemaDirectory>src/main/resources/</schemaDirectory>
          <generatePackage>org.jaxb.po</generatePackage>
          <includeSchemas>
            <includeSchema>PO.xsd</includeSchema>
         </includeSchemas>
         <generateDirectory>src/main/java</generateDirectory>
         <removeOldOutput>true</removeOldOutput>
         <verbose>true</verbose>
        </configuration>
        
      </plugin>


      <plugin>
        <groupId>com.sun.tools.xjc.maven2</groupId>
        <artifactId>maven-jaxb-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <schemaDirectory>src/main/resources/</schemaDirectory>
          <generatePackage>org.jaxb.item</generatePackage>
          <includeSchemas>
            <includeSchema>Item.xsd</includeSchema>
         </includeSchemas>
         <generateDirectory>src/main/java</generateDirectory>
         <removeOldOutput>true</removeOldOutput>
         <verbose>true</verbose>
        </configuration>
        
      </plugin>






      ____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7