I am using
ant to distribute a set of folders for a web application.
I am using a book called mySQL and jspIt is a zip file, which I unzip.
the xml files I have to change are not read only - but the higher level files are and I have tried unchecking the read only attribute but is gets rechecked to read only.
The build is the build file:
Where I point to:
c:\jakarta-tomcat-4.0.6\webapps\bfg\
----------------------------------------------------------------
<project name="BfgWebsite" default="dist" basedir=".">
<property name="tomcatdir" value="/tomcat"/>
<property name="appdir" value="${tomcatdir}/webapps/bfg"/>
<property name="jarfile" value="bfgclasses.jar"/>
<target name="init">
<tstamp/>
</target>
<target name="compile" depends="init">
<javac srcdir="src">
<classpath>
<pathelement path="${classpath}"/>
<pathelement path="src"/>
<fileset dir="c:\jakarta-tomcat-4.0.6\lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="c:\jakarta-tomcat-4.0.6\common">
<include name="**/*.jar"/>
</fileset>
<fileset dir="c:\jakarta-tomcat-4.0.6\webapps\bfg\WEB-INF\lib\">
<include name="**/*.jar"/>
<exclude name="bfgclasses.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="dist" depends="compile">
<mkdir dir="${appdir}/WEB-INF/lib"/>
<mkdir dir="${appdir}/logs"/>
<jar jarfile="${appdir}/WEB-INF/lib/${jarfile}">
<fileset dir="src" includes="**/*.class"/>
<fileset dir="props" includes="**/*.properties"/>
</jar>
<copy todir="${appdir}/WEB-INF">
<fileset dir="." includes="web.xml"/>
<fileset dir="." includes="TurbineResources.properties"/>
<fileset dir="props" includes="log4j.properties"/>
</copy>
<mkdir dir="${appdir}/jsp"/>
<copy todir="${appdir}/jsp">
<fileset dir="jsp"/>
</copy>
<delete dir="${tomcatdir}/work/localhost/bfg"/>
</target>
<target name="test" depends="dist">
<
java classname="com.bfg.customer.Customer" fork="yes">
<classpath>
<pathelement path="${java.class.path}"/>
<fileset dir="c:\jakarta-tomcat-4.0.6\lib">
<include name="**/*.jar"/>
</fileset>
<pathelement path="src"/>
<pathelement path="props"/>
</classpath>
</java>
<java classname="com.bfg.product.Product" fork="yes">
<classpath>
<pathelement path="${java.class.path}"/>
<fileset dir="c:\jakarta-tomcat-4.0.6\lib">
<include name="**/*.jar"/>
</fileset>
<pathelement path="src"/>
<pathelement path="props"/>
</classpath>
</java>
<java classname="com.bfg.product.Category" fork="yes">
<classpath>
<pathelement path="${java.class.path}"/>
<fileset dir="c:\jakarta-tomcat-4.0.6\lib">
<include name="**/*.jar"/>
</fileset>
<pathelement path="src"/>
<pathelement path="props"/>
</classpath>
</java>
</target>
<target name="start">
<exec dir="${tomcatdir}/bin" executable="startup.bat"
os="Windows 2000" vmlauncher="false">
</exec>
</target>
<target name="stop">
<exec dir="${tomcatdir}/bin" executable="shutdown.bat"
os="Windows 2000" vmlauncher="false">
</exec>
</target>
<target name="restart" depends="stop,start">
</target>
</project>
web.xml
<?xml version="1.0"?>
<web-app>
<
servlet>
<servlet-name>log4j-init</servlet-name>
<servlet-class>com.bfg.services.Log4jInit</servlet-class>
<init-param>
<param-name>log4j-init-file</param-name>
<param-value>WEB-INF/log4j.properties</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>turbine-init</servlet-name>
<servlet-class>com.bfg.services.TurbineInit</servlet-class>
<init-param>
<param-name>turbine-resource-directory</param-name>
<param-value> c:/jakarta-tomcat-4.0.6/webapps/bfg/WEB-INF</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<session-config>
<session-timeout>5</session-timeout>
</session-config>
<resource-ref>
<res-ref-name>mail/session</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
<param-value> c:\jakarta-tomcat-4.0.6/webapps/bfg/WEB-INF</param-value>
again points to
c:/jakarta-tomcat-4.0.6/webapps/bfg/
I run ant with the following and I get the below, I do not know why it creates
C:\tomcat\webapps\bfg
Not :
c:\jakarta-tomcat-4.0.6\webapps\bfg
---------------------------------
init:
compile:
dist:
[mkdir] Created dir: C:\tomcat\webapps\bfg\WEB-INF\lib
[mkdir] Created dir: C:\tomcat\webapps\bfg\logs
[jar] Building jar: C:\tomcat\webapps\bfg\WEB-INF\lib\bfgclasses.jar
[copy] Copying 3 files to C:\tomcat\webapps\bfg\WEB-INF
[mkdir] Created dir: C:\tomcat\webapps\bfg\jsp
[copy] Copying 35 files to C:\tomcat\webapps\bfg\jsp
BUILD SUCCESSFUL
Total time: 1 second
C:\TEMP\cartapp\bfg>
(this is where I have the xml and cartapp files) � temp /../
AM I doing something wrong with ant?
I tried taking the read write off the files, but it will not stay off, but it is not on the xml files � would this make a difference?
Not sure what else to try