Eclipse Web Project没有使用ANT构建?

时间:2012-04-18 14:02:25

标签: java eclipse ant

Eclipse Web Project没有使用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会员咨询] $ ant Buildfile:build.xml

积子项目:

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

积项目:      [echo] MemberInquiry:/home/jsmith/uft-workspace/MemberInquiry/build.xml

构建

建立成功 总时间:0秒

请让我知道要做什么

1 个答案:

答案 0 :(得分:2)

那个特定的ant脚本不构建战争,它所做的就是编译java。您必须在eclipse中采取一些其他操作来创建war文件,而不是简单地运行此ant脚本。