Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven jaxb generate plugin to read xsd files from multiple directories

Tags:

java

maven

jaxb

xsd

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

like image 696
ziggy Avatar asked Dec 27 '22 20:12

ziggy


1 Answers

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

like image 186
Timouyas Avatar answered Apr 04 '23 12:04

Timouyas