Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy files and folder to WEB-INF using Ant

Tags:

copy

war

ant

I want to copy a .properties file from a certain location to my WEB-INF/classes/com/infiniti folder(in a WAR file).

I have gone through this link How to get Ant to copy properties file to classes directory using which I can copy the .properties file to WEB-INF/classes/ but not to WEB-INF/classes/com/infiniti

Code I am using is:

<war destfile="${deploy}/acc.war" webxml="${warSrc}/web/WEB-INF/web.xml">
            <lib dir="${lib}">
.......
.......
.......
            <classes dir="${configHome}/config/com/infiniti">
                <include name="accredit.properties" />
            </classes>

...
....
.......
</war>

Also I need to copy ${configHome}/resources/com/infiniti/errorcode folder to WEB-INF/classes/com/infiniti.

Is this possible using Ant?

like image 798
antnewbee Avatar asked Dec 28 '22 03:12

antnewbee


1 Answers

yes, you can use for instance ZipFileSet like this

<war destfile="${deploy}/acc.war" webxml="${warSrc}/web/WEB-INF/web.xml">
...
    <zipfileset dir="${configHome}/config/com/infiniti" includes="**/*.properties" prefix="WEB-INF/classes/com/infiniti"/>
like image 148
michele b Avatar answered Jan 13 '23 12:01

michele b