How to avoid the need to specify the WSDL location in a CXF or JAX-WS generated webservice client?

I finally figured out the right answer to this question today. <plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>${cxf.version}</version> <executions> <execution> <id>generate-sources</id> <phase>generate-sources</phase> <configuration> <sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot> <wsdlOptions> <wsdlOption> <wsdl>${project.basedir}/src/main/resources/wsdl/FooService.wsdl</wsdl> <wsdlLocation>classpath:wsdl/FooService.wsdl</wsdlLocation> </wsdlOption> </wsdlOptions> </configuration> <goals> <goal>wsdl2java</goal> </goals> </execution> </executions> </plugin> Notice that I have prefixed the value in wsdlLocation with classpath:. This tells the plugin that the wsdl will be on … Read more