Fork me on GitHub

Use wsdlLocation as a path prefix for multiple WSDL URLs

<project>
  ...
  <dependencies>
      ...
    <dependency>
      <groupId>com.sun.xml.ws</groupId>
      <artifactId>jaxws-rt</artifactId>
      <version>2.2.10</version>
    </dependency>
    ...
  </dependencies>
  ...
  <build>
    ...
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
        <version>2.6</version>
        <executions>
          <execution>
            <goals>
              <goal>wsimport</goal>
            </goals>
            <!-- Following configuration will invoke wsimport once for each wsdl. -->
            <configuration>
              <wsdlLocation>http://example.com/mywebservices/*</wsdlLocation>
              <wsdlDirectory>src/mywsdls</wsdlDirectory>
              <wsdlFiles>
                <wsdlFile>a.wsdl</wsdlFile>                         <!-- produces wsdlLocation = http://example.com/mywebservices/a.wsdl -->
                <wsdlFile>b/b.wsdl</wsdlFile>                       <!-- produces wsdlLocation = http://example.com/mywebservices/b/b.wsdl -->
                <wsdlFile>${project.basedir}/src/mywsdls/c.wsdl</wsdlFile>  <!-- produces wsdlLocation = /path/to/basedir/src/mywsdls/c.wsdl -->
              </wsdlFiles>
            </configuration>
          </execution>
        </executions>
      </plugin>
      ...
    </plugins>
    ...
  <build>
  ...
</project>