我在工作中使用了jaxws-maven-plugin来进行代码生成。我有两个项目,一个是“common”,另一个是“client”。它们的结构大致如下:
app/
common/
resource/
some.xsd
client/
resource/
some.wsdl
如何使用"common"项目中的xsd,在"client"项目中从wsdl生成类?
pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<verbose>true</verbose>
<bindingFiles>
<bindingFile>${project.parent.basedir}/common/resource/some.xsd</bindingFile>
</bindingFiles>
<wsdlFiles>
<wsdlFile>/resource/some.wsdl</wsdlFile>
</wsdlFiles>
</configuration>
</execution>
</executions>
</plugin>