2

I am having a WSDL (lets say one.wsdl ) from which I want to generate JAXB artifacts using maven plugin. one.wsdl imports another wsdl (two.wsdl ) . When I am running the maven plugin to generate the JAXB artifacts , looks like its not recognizing two.wsdl and not generating the JAXB artifacts.

<plugin>
    <groupId>org.jvnet.jaxb2.maven2</groupId>
    <artifactId>maven-jaxb2-plugin</artifactId>
    <version>0.7.5</version>
    <executions>
        <execution>
            <id>DataBindings_XJC_generate</id>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <schemaDirectory>src/main/resources/wsdl/</schemaDirectory>
                <schemaIncludes>
                    <include>one.wsdl</include>
                </schemaIncludes>
                <generateDirectory>src/main/java/</generateDirectory>
                <generatePackage></generatePackage>
                <readOnly>true</readOnly>
                <removeOldOutput>true</removeOldOutput>
                <verbose>true</verbose>
                <extension>false</extension>
                <forceRegenerate>true</forceRegenerate>
                <episode>false</episode>
            </configuration>
        </execution>
    </executions>
</plugin>

one.wsdl is refering to two.wsdl like this (both are in same directory).

<wsdl:import namespace="http://namespce:uri" location="two.wsdl"/>

However If i give the two.wsdl (in the include tag) in plugin , its able to generate the jaxb artifacts successfully.

Can anyone please suggest what might have gone wrong with the plugin when it comes to recognizing the imported WSDL ?

lexicore
  • 42,748
  • 17
  • 132
  • 221
KBR
  • 464
  • 1
  • 7
  • 24

1 Answers1

1

maven-jaxb2-plugin is just a wrapper for XJC. It does not do any schema processing on it own, it just calls XJC.

Please send me a test case as a PR request here:

https://github.com/highsource/maven-jaxb2-plugin/tree/master/tests

I'll check if this has something to do with the plugin (unlikely) or forward it to Oracle.

I think, this might be also by design - if your one.wsdl does not use anything from two.wsdl then nothing for the two.wsdl will be generated.

lexicore
  • 42,748
  • 17
  • 132
  • 221
  • 1
    Is there any solution? I have the same case, when `one.wsdl` has import of `two.wsdl`. In case when I generate from `two.wsdl`, it throws exception - no xmlrootelement – BSeitkazin May 14 '18 at 04:53
  • @BSeitkazin Same answer. Send me a PR with a reproducing project here: https://github.com/highsource/maven-jaxb2-plugin-support – lexicore May 14 '18 at 07:55