users@jaxb.java.net

Generating Java bindings in different packages

From: Jean_at_Eastcode <jean.eastcode_at_gmail.com>
Date: Mon, 25 Oct 2010 03:20:15 -0700 (PDT)

Hi,

I'm using jaxb2-maven-plugin to get automatic generation of my Java bindings
from XSDs.

I'm introducing the use of Enums, hence I have to create simpleTypes that
maps the Java Enum values.

The XSD as well as the generated classes are all in a binding "package"

The enums are in a different package since they are not autogenerated,
called "model".

I want the generated classes to use the original Java "model" enum, but jaxb
keep generating them into "binding".

I've split all the simpleType corresponding to the Java enums in a
EnumTypes.xsd that I put in "model" but still, corresponding Java enums are
always created in "binding".

Is there a way to generate EnumsTypes.xsd classes in "model", and to have
classes generated into "binding" be linked to them?

FYI, here's my plugin config:

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <id>binding</id>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                        <configuration>
                           
<schemaDirectory>src/main/resources/com//comp/project/app/common/binding</schemaDirectory>
                           
<packageName>com.comp.project.app.common.binding</packageName>
                           
<outputDirectory>src/main/generated</outputDirectory>
                            <clearOutputDir>false</clearOutputDir>
                        </configuration>
                    </execution>
                    <execution>
                        <id>model</id>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                        <configuration>
                           
<schemaDirectory>src/main/resources/com/comp/project/app/common/model</schemaDirectory>
                           
<packageName>com.comp.project.app.common.model</packageName>
                           
<outputDirectory>src/main/generated</outputDirectory>
                            <clearOutputDir>false</clearOutputDir>
                        </configuration>
                    </execution>
                </executions>

cheers


-- 
View this message in context: http://old.nabble.com/Generating-Java-bindings-in-different-packages-tp30046469p30046469.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.