External binding files can be passed to wsimport mojo in two ways:
<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 pass ${project.basedir}/src/remote-xjc/bindings.xjc and ${project.basedir}/src/jaxws/bindings-default.xjc to wsimport. --> <configuration> <bindingFiles> <bindingFile>${project.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>
<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 pass all XML files from ${project.basedir}/src/bindings to wsimport. --> <configuration> <bindingDirectory>${project.basedir}/src/bindings</bindingDirectory> <wsdlUrls> <wsdlUrl>http://example.com/mywebservices/MyService?WSDL</wsdlUrl> </wsdlUrls> </configuration> </execution> </executions> </plugin> ... </plugins> ... <build> ... </project>