2011-07-12 48 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是新手。感谢您指点我的文档。这有帮助。 –

相关问题