0

Eclipse Web 项目不是用 ANT 构建的……我让 Eclipse 构建了我的 build.xml 文件,但是如果我转到注释行并运行 ANT,它不会在任何地方生成 WAR 文件。有人可以告诉我为什么吗?

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
              Any modifications will be overwritten.
              To include a user specific buildfile here, simply create one in the same
              directory with the processing instruction <?eclipse.ant.import?>
              as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="MemberInquiry">
    <property environment="env"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.6"/>
    <property name="source" value="1.6"/>
    <path id="Apache Tomcat v6.0 [Apache Tomcat v6.0].libraryclasspath">
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/tomcat-i18n-ja.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/catalina.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/commons-pool.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/jasper-el.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/jasper-jdt.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/jboss-logging-jdk.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/mysql-connector-java-5.0.5.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/catalina-ant.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/tomcat-coyote.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/jsp-api.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/jasper.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/tomcat-i18n-fr.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/commons-dbcp.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/tomcat-juli-adapters.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/el-api.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/catalina-ha.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/tomcat-dbcp.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/log4j.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/annotations-api.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/mod-cluster.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/jboss-logging-spi.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/servlet-api.jar"/>
        <pathelement location="../../jboss-ews-1.0/tomcat6/lib/tomcat-i18n-es.jar"/>
    </path>
    <path id="Web App Libraries.libraryclasspath">
        <pathelement location="WebContent/WEB-INF/lib/activation-1.0.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/antlr-2.7.6.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/aopalliance-1.0.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/asm-1.5.3.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/asm-attrs-1.5.3.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/cas-client-core-3.2.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/cglib-2.1_3.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-beanutils-1.7.0.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-codec-1.4.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-collections-2.1.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-dbcp.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-digester-1.8.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-email-1.0.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-fileupload-1.1.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-io-1.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-lang-2.5.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-logging-1.1.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-pool.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/dom4j-1.6.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/dumbster-1.6.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/ehcache-1.2.3.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/hibernate-3.2.6.ga.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/hibernate-annotations-3.3.1.GA.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/hibernate-commons-annotations-3.0.0.ga.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/hibernate-entitymanager-3.3.2.GA.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/hibernate-search-3.0.0.GA.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/hibernate-validator-4.0.2.GA.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/httpclient-4.1.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/httpclient-cache-4.1.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/httpcore-4.1.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/httpmime-4.1.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/icu4j-2.6.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/javassist-3.4.GA.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/jaxb-api-2.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/jaxb-impl-2.1.3.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/jaxen-1.1.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/jdom-1.0.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/jstl-1.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/jta-1.1.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/log4j-1.2.14.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/lucene-core-2.3.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/lucene-highlighter-2.0.0.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/mail-1.4.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/mysql-connector-java-5.0.5.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/persistence-api-1.0.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/quartz-1.5.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/slf4j-api-1.5.6.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/slf4j-log4j12-1.5.6.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-aop-3.0.1.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-asm-3.0.1.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-beans-3.0.1.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-context-3.0.1.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-core-3.0.1.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-expression-3.0.1.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-jdbc-3.0.1.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-ldap-1.3.0.RELEASE-all.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-orm-3.0.1.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-acl-3.0.5.RELEASE-sources.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-acl-3.0.5.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-aspects-3.0.5.RELEASE-sources.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-aspects-3.0.5.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-cas-client-3.0.5.RELEASE-sources.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-cas-client-3.0.5.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-config-3.0.5.RELEASE-sources.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-config-3.0.5.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-core-3.0.5.RELEASE-sources.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-core-3.0.5.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-ldap-3.0.5.RELEASE-sources.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-ldap-3.0.5.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-openid-3.0.5.RELEASE-sources.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-openid-3.0.5.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-taglibs-3.0.5.RELEASE-sources.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-taglibs-3.0.5.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-web-3.0.5.RELEASE-sources.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-security-web-3.0.5.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-tx-3.0.1.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-web-3.0.1.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/spring-webmvc-3.0.1.RELEASE.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/stax-api-1.0-2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/validation-api-1.0.0.GA.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/xalan-2.6.0.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/xercesImpl-2.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/xml-apis-1.3.02.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/xmlParserAPIs-2.6.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/xom-1.0.jar"/>
        <pathelement location="WebContent/WEB-INF/classes"/>
    </path>
    <path id="EAR Libraries.libraryclasspath"/>
    <path id="MemberInquiry.classpath">
        <pathelement location="build/classes"/>
        <path refid="Apache Tomcat v6.0 [Apache Tomcat v6.0].libraryclasspath"/>
        <path refid="Web App Libraries.libraryclasspath"/>
        <path refid="EAR Libraries.libraryclasspath"/>
        <pathelement location="WebContent/WEB-INF/lib/httpclient-4.1.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/httpclient-cache-4.1.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/httpcore-4.1.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/httpmime-4.1.2.jar"/>
        <pathelement location="WebContent/WEB-INF/lib/commons-codec-1.4.jar"/>
        <pathelement location="WebContent/WEB-INF/classes/log4j.xml"/>
    </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="MemberInquiry.classpath"/>
        </javac>
    </target>
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
</project>

这是屏幕的输出:

[jsmith@wcmisdlin07 MemberInquiry]$ ant Buildfile: build.xml

构建子项目:

init: [copy] 将 1 个文件复制到 /home/jsmith/uft-workspace/MemberInquiry/build/classes

build-project: [echo] MemberInquiry: /home/jsmith/uft-workspace/MemberInquiry/build.xml

建造:

构建成功总时间:0 秒

请让我知道要尝试什么

4

1 回答 1

2

那个特定的 ant 脚本不会构建战争,它所做的只是编译 java.util. 除了简单地运行这个 ant 脚本之外,您还必须在 eclipse 中执行一些其他操作来创建一个 war 文件。

于 2012-04-18T21:03:13.937 回答