0

私は自分のantに以下のタスクを持っており、jdbc.properties、applicationContext.xmlなどのすべてのファイルをWEB-INFフォルダーの外にコピーしています。しかし、必要なのは、WEB-INF フォルダーの下に配置するファイルです。どうすればこれを達成できますか?

<war destfile="my.war" webxml="web/WEB-INF/web.xml">
   <classes dir="build/web/WEB-INF/classes"/>
   <fileset dir="web/WEB-INF"/>
   <lib dir="web/WEB-INF/lib"/>
   <zipfileset dir="web/images" prefix="images"/>
</war>
4

1 に答える 1

0

の代わりに、プレフィックスパラメーターを宣言できることを除いて、同じよう<fileset>に使用します。<sipfileset><fileset>

<war destfile="my.war" webxml="web/WEB-INF/web.xml">
    <classes dir="build/web/WEB-INF/classes"/>
    <zipfileset dir="web/WEB-INF"
        prefix=WEB-INF"/>
    <lib dir="web/WEB-INF/lib"/>
    <zipfileset dir="web/images" prefix="images"/>
</war>

または、これらのファイルは既にディレクトリの下にあるため、ディレクトリに を指定して、その下のディレクトリのみを指定WEB-INFできます。<fileset>webWEB-INF

<war destfile="my.war" webxml="web/WEB-INF/web.xml">
    <classes dir="build/web/WEB-INF/classes"/>
    <fileset dir="web">
        <include name="WEB-INF/**"/>
    </fileset>
    <lib dir="web/WEB-INF/lib"/>
    <zipfileset dir="web/images" prefix="images"/>
</war>
于 2012-12-17T14:49:55.430 に答える