I have a JAX-WS-driven web service whose WSDL we generate a web service client from in another Maven module (which I'll call ws-consumer
).
For better or worse, we copy the "published WSDLs" (the version of the WSDL & XSDs that the service held/generated at point of release) to our src/wsdl
folder of ws-consumer
and then use jaxws-maven-plugin
from org.jvnet to generate a client using jaxws:wsimport
with the following (truncated) configuration:
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<!--phase>generate-sources</phase -->
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlDirectory>src/main/resources/META-INF/wsdl/</wsdlDirectory>
<wsdlFiles>
<wsdlFile>MyWS/MyWS.wsdl</wsdlFile>
</wsdlFiles>
</configuration>
</execution>
</executions>
</plugin>
Now, the generated client code has the following annotations applied at the class level:
@WebServiceClient(name = "MyWS", targetNamespace = "http://myws/blah", wsdlLocation = "**file:/C:/some/absolute/path/src/main/resources/META-INF/wsdl/MyWS/MyWS.wsdl"**)
emphasis mine
As you can hopefully see, the wsdlLocation
attribute value has a hard-coded absolute path that is going to be incorrect when the service is deployed.
Is there any way I can "control" this by setting it to just META-INF/wsdl/MyWS/MyWS.wsdl
or some other value?