I am using jaxws-maven-plugin version 2.1 . I found very strange code created to host WSDL from jar resources:
<configuration> <keep>true</keep> <sourceDestDir>${basedir}/src/main/java</sourceDestDir> <extension>true</extension> <wsdlDirectory>${basedir}/src/main/resources/wsdl</wsdlDirectory> <packageName>my.package.gen</packageName> <wsdlLocation>wsdl/*</wsdlLocation> <wsdlFiles> <wsdlFile>mywsdl.wsdl</wsdlFile> </wsdlFiles> </configuration>
And the generated code:
static { URL url = null; try { URL baseUrl; baseUrl = my.package.gen.My_Service.class.getResource("."); url = new URL(baseUrl, "wsdl/mywsdl.wsdl"); } catch (MalformedURLException e) { logger.warning("Failed to create URL for the wsdl Location: 'wsdl/mywsdl.wsdl', retrying as a local file"); logger.warning(e.getMessage()); } MYSERVICE_WSDL_LOCATION = url; }
Thus, the wsdl file is viewed in the directory (package) of the generated classes, and not in the main jar directory, as it would be logical. And WSDL could not be found.
Is this a bug in jaxws jaxws-maven-plugin , or is it a bug in my configuration?
source share