2016-05-23 6 views
0

WSDLからWebサービスを生成するためにmavenプラグインを使用しています。このサービスで&プロセス添付ファイルを受け入れるようにします。私は、Webサービスのサービスインターフェイスに注釈を付ける必要があることを知りました。しかし、Mavenから生成されたスタブにはこれが含まれていません。どうすれば達成できますか?プラグインまたは外部バインディングファイルのパラメータとして指定する方法はありますか? 現在、私のプラグインは以下のようになります(その一部)Apache CXF wsdl2Java指定消費

<plugin> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-codegen-plugin</artifactId> 
     <version>${cxf.version}</version> 
     <executions> 
      <execution> 
       <id>generate-sources</id> 
       <configuration> 
        <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot> 
        <wsdlOptions> 
         <wsdlOption> 
          <wsdl>${basedir}/src/main/resources/wsdl/answersheetService.wsdl</wsdl> 
          <extraargs> 
           <extraarg>-b</extraarg> 
           <extraarg>${basedir}/src/main/resources/wsdl/answersheet_binding.xml</extraarg> 
           <extraarg>-validate</extraarg> 
           <extraarg>-autoNameResolution</extraarg> 
           <extraarg>-client</extraarg> 
          </extraargs> 
         </wsdlOption> 

答えて

0

私も同様の問題に直面しています。 cxf-codegen-pluginにはcodeneationに必要な容量がなく、私はmaven-replacer-pluginを使用しています。私の場合はクラス名をパッケージ名に置き換えました。

<plugin> 
    <groupId>com.google.code.maven-replacer-plugin</groupId> 
    <artifactId>replacer</artifactId> 
    <executions> 
     <execution> 
      <id>replace-fault-names</id> 
      <goals> 
       <goal>replace</goal> 
      </goals> 
      <phase>generate-sources</phase> 
      <configuration> 
       <file> 
        ${basedir}/target/generated-sources/src/package/YourClass.java 
       </file> 
       <replacements> 
        <replacement> 
         <token>source-value</token> 
         <value>target-value</value> 
        </replacement> 
       </replacements> 
      </configuration> 
     </execution> 
    </executions> 
</plugin> 
関連する問題