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>2.2.8</version>
        </dependency>
        ...
      </dependencies>
      ...
      <build>
        ...
        <plugins>
          <plugin>
            <groupId>org.jvnet.jax-ws-commons</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>2.3</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>2.2.8</version>
        </dependency>
        ...
      </dependencies>
      ...
      <build>
        ...
        <plugins>
          <plugin>
            <groupId>org.jvnet.jax-ws-commons</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>2.3</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>

Terms of Use; Privacy Policy; Copyright ©2013-2014 (revision 20131025.e7cbc9d)
 
 
Close
loading
Please Confirm
Close