Maven jaxb generates a plugin to read xsd files from several directories

advertisements

If i have xsd file in the following directories

src/main/resources/xsd
src/main/resources/schema/common
src/main/resources/schema/soap

How can i instruct the maven jaxb plugin to generate jaxb classes using all schema files in the above directory? I can get it to generate the class files if i specify one of the folders but i cant get i dont know how to include all three folders.

Here is how i generate the files for one folder:

<plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <schemaDirectory>src/main/resources/xsd</schemaDirectory>
            </configuration>
        </plugin>

I tried adding multiple entries in the element but it just ignores all of them if i do that.

Thanks


u can try this configuration :

<configuration>
        <schemaDirectory>src/main/resources</schemaDirectory>
    <schemaIncludes>
        <include>xsd/*.xsd</include>
            <include>schema/*/*.xsd</include>
    </schemaIncludes>
</configuration>

source : http://confluence.highsource.org/display/MJIIP/User+Guide