2011-07-12 82 views
1

如何獲取此Ant文件以在./src目錄中生成我的存根,而不是目標「generate-service-stub」的根目錄?使用Axis和Ant在./src而不是根目錄中生成存根(stub)而不是根目錄

我的目錄結構是這樣的:

  • 我的項目/
    • 的build.xml
    • 的src/

的命名空間在我的WSDL定義爲「http ://www.example.org/SimpleService/」。因此,構建結束後,目錄結構如下所示:

- My Project/ 
    - build.xml 
    - src/ 
    - org/ <-- notice how this falls outside of the src/ directory 
    - example 
     - www 
     - SimpleService 
      - *.java 
      - *.wsdd 

但我希望它看起來像這樣:

- My Project/ 
    - build.xml 
    - src/ 
    - org/ <-- notice how this falls within the src/ directory 
     - example 
     - www 
      - SimpleService 
      - *.java 
      - *.wsdd 

這是我的build.xml文件:

<project name="SimpleService"> 
    <property name="axis.home" value="C:/axis-1_4" /> 
    <property name="javamail.home" value="C:/javamail-1.4.4" /> 
    <property name="jsf.home" value="C:/jaf-1.1" /> 
    <path id="axis.classpath"> 
     <fileset dir="${axis.home}/lib"> 
      <include name="**/*.jar" /> 
     </fileset> 
     <fileset dir="${javamail.home}"> 
      <include name="**/*.jar" /> 
     </fileset> 
     <fileset dir="${jsf.home}"> 
      <include name="**/*.jar" /> 
     </fileset> 
    </path> 
    <taskdef resource="axis-tasks.properties" classpathref="axis.classpath" /> 
    <target name="generate-service-stub"> 
     <axis-wsdl2java serverside="true" url="SimpleService.wsdl"> 
     </axis-wsdl2java> 
    </target> 
</project> 

或者它的工作方式實際上是首選,所以我不會無意中覆蓋我的* SOAPImpl.java文件?

回答

1

axis-wsdl2java Ant task有一個屬性output來控制目標。所以它應該是這樣的:

<axis-wsdl2java serverside="true" url="SimpleService.wsdl" output="src" /> 
+0

謝謝,馬丁。你可以告訴我對Ant和Axis是新手。感謝您指點我的文檔。這有幫助。 –

相關問題