Java 在ant部署问题中找不到war文件

Java 在ant部署问题中找不到war文件,java,web-services,ant,Java,Web Services,Ant,我是java开发的初学者。我在eclipse中使用axis2编写了一个web服务,并在eclipse中使用export选项创建了一个ant构建文件。我尝试使用ant创建war文件,但找不到web服务的war文件。 生成的eclipse构建文件是 <?xml version="1.0" encoding="UTF-8" standalone="no"?> <project basedir="." default="build" name="MainWarehouse">

我是java开发的初学者。我在eclipse中使用axis2编写了一个web服务,并在eclipse中使用export选项创建了一个ant构建文件。我尝试使用ant创建war文件,但找不到web服务的war文件。 生成的eclipse构建文件是

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<project basedir="." default="build" name="MainWarehouse">
    <property environment="env"/>
    <property name="ECLIPSE_HOME" value="../../../../../Program Files/eclipse-jee-indigo-win32/eclipse"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.6"/>
    <property name="source" value="1.6"/>
    <path id="Apache Tomcat v7.0 [Apache Tomcat v7.0 (5)].libraryclasspath">
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/annotations-api.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/catalina-ant.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/catalina-ha.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/catalina-tribes.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/catalina.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/ecj-3.7.1.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/el-api.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/jasper-el.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/jasper.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/jsp-api.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/servlet-api.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-api.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-coyote.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-dbcp.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-i18n-es.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-i18n-fr.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-i18n-ja.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-jdbc.jar"/>
        <pathelement location="../../../../../Program Files/Apache Software Foundation/Tomcat 7.0/lib/tomcat-util.jar"/>
    </path>
    <path id="Web App Libraries.libraryclasspath">
        <pathelement location="WebContent/WEB-INF/lib/XmlSchema-1.4.7.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/activation-1.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/antlr-2.7.7.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axiom-api-1.2.13.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axiom-dom-1.2.13.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axiom-impl-1.2.13.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-adb-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-adb-codegen-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-ant-plugin-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-clustering-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-codegen-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-corba-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-fastinfoset-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-java2wsdl-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-jaxbri-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-jaxws-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-jibx-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-json-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-kernel-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-metadata-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-mtompolicy-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-saaj-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-soapmonitor-servlet-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-spring-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-transport-http-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-transport-local-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/axis2-xmlbeans-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-cli-1.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-codec-1.3.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-fileupload-1.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-httpclient-3.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-io-1.4.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-logging-1.1.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/httpcore-4.0.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/log4j-1.2.15.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/mail-1.4.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/neethi-3.0.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/woden-api-1.0M9.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/woden-impl-commons-1.0M9.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/woden-impl-dom-1.0M9.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/wsdl4j-1.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/wstx-asl-3.2.9.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/xmlbeans-2.3.0.jar"/>
        <pathelement location="WebContent/WEB-INF/classes"/>
    </path>
    <path id="EAR Libraries.libraryclasspath"/>
    <path id="MainWarehouse.classpath">
        <pathelement location="build/classes"/>
        <path refid="Apache Tomcat v7.0 [Apache Tomcat v7.0 (5)].libraryclasspath"/>
        <path refid="Web App Libraries.libraryclasspath"/>
        <path refid="EAR Libraries.libraryclasspath"/>
    </path>
    <target name="init">
        <mkdir dir="build/classes"/>
        <copy includeemptydirs="false" todir="build/classes">
            <fileset dir="src">
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
    </target>
    <target name="clean">
        <delete dir="build/classes"/>
    </target>
    <target depends="clean" name="cleanall"/>
    <target depends="build-subprojects,build-project" name="build"/>
    <target name="build-subprojects"/>
    <target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="build/classes" source="${source}" target="${target}">
            <src path="src"/>
            <classpath refid="MainWarehouse.classpath"/>
        </javac>
    </target>
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
    <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
        <copy todir="${ant.library.dir}">
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </copy>
        <unzip dest="${ant.library.dir}">
            <patternset includes="jdtCompilerAdapter.jar"/>
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </unzip>
    </target>
    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
        <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
        <antcall target="build"/>
    </target>
</project>

然后我右键单击build.xml并以ant build的形式运行,然后eclipse的输出是

构建文件:C:\Documents and Settings\K.M.S Kumara\My Documents\JavaEclipse\MainWarehouse\build.xml

初始化: [mkdir]创建目录:C:\Documents and Settings\K.M.S Kumara\My Documents\JavaEclipse\MainWarehouse\build\classes 建设成功 总时间:687毫秒


但是我找不到war文件。请给我生成war文件的帮助。

在Ant构建文件中没有用于构建war的内容,它只执行编译步骤,将.class文件放入
build/classes
。谢谢,我如何使用build.xml构建war文件?我需要使用其他标记吗?生成的文件太可怕了。