Skip to main content
JAX-WS Maven plugin –

External binding files can be passed to wsimport mojo in two ways:

  • using bindingFiles configuration element - absolute and/or relative paths can be used. Note that relative path have their base directory set to src/jaxws
    <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 pass ${basedir}/src/remote-xjc/bindings.xjc and ${basedir}/src/jaxws/bindings-default.xjc to wsimport. -->
                <configuration>
                  <bindingFiles>
                    <bindingFile>${basedir}/src/remote-xjc/bindings.xjc</bindingFile>
                    <bindingFile>bindings-default.xjc</bindingFile>
                  </bindingFiles>
                  <wsdlUrls>
                    <wsdlUrl>http://example.com/mywebservices/MyService?WSDL</wsdlUrl>
                  </wsdlUrls>
                </configuration>
              </execution>
            </executions>
          </plugin>
          ...
        </plugins>
        ...
      <build>
      ...
    </project>
  • using bindingDirectory configuration element - all XML files from this directory will be passed to wsimport
    <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 pass all XML files from ${basedir}/src/bindings to wsimport. -->
                <configuration>
                  <bindingDirectory>${basedir}/src/bindings</bindingDirectory>
                  <wsdlUrls>
                    <wsdlUrl>http://example.com/mywebservices/MyService?WSDL</wsdlUrl>
                  </wsdlUrls>
                </configuration>
              </execution>
            </executions>
          </plugin>
          ...
        </plugins>
        ...
      <build>
      ...
    </project>

Back to the top