Skip to main content
JAX-WS Maven plugin –

Use wsdlLocation as a path prefix for multiple WSDL URLs

<project>
  ...
  <dependencies>
      ...
    <dependency>
      <groupId>com.sun.xml.ws</groupId>
      <artifactId>jaxws-rt</artifactId>
      <version>3.0.0</version>
    </dependency>
    ...
  </dependencies>
  ...
  <build>
    ...
    <plugins>
      <plugin>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
        <version>3.0.0</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>${basedir}/src/mywsdls/c.wsdl</wsdlFile>  <!-- produces wsdlLocation = /path/to/basedir/src/mywsdls/c.wsdl -->
              </wsdlFiles>
            </configuration>
          </execution>
        </executions>
      </plugin>
      ...
    </plugins>
    ...
  <build>
  ...
</project>

Back to the top