2010-12-10 61 views

回答

2

cxf-codegen-plugin應該完成這項工作。

<plugin> 
    <groupId>org.apache.cxf</groupId> 
    <artifactId>cxf-codegen-plugin</artifactId> 
    <executions> 
     <execution> 
     <id>generate-sources-composite</id> 
     <phase>generate-sources</phase> 
     <configuration> 
      <sourceRoot>${basedir}/target/generated-sources/wsdl2java</sourceRoot> 
      <defaultOptions> 
      </defaultOptions> 
      <wsdlOptions> 
       <wsdlOption> 
        <wsdl>${basedir}/src/main/wsdl/service1.wsdl</wsdl> 
       </wsdlOption> 
       <wsdlOption> 
        <wsdl>${basedir}/src/main/wsdl/service2.wsdl</wsdl> 
       </wsdlOption> 
      </wsdlOptions> 
     </configuration> 
     <goals> 
      <goal>wsdl2java</goal> 
     </goals> 
    </execution> 
    </executions> 
</plugin> 

有了這個配置,你只需要設置的WSDL文件和Java源代碼生成的文件夾(這應該是在目標文件夾)