I have a build file in which I have a tasks as below
//tomcat stop ant script
When I run **tomcat-stop** task, instead of picking up the lib folder from tomcat server, it is trying to take my working directory.
I have set the project basedir as basedir=".". All my other tasks in the build file are working as expected but only in this scenario (tomcat-stop) I am finding an issue.
Error:
**C:\Dev\WebDev\XYZ\build.xml:103: C:\Dev\WebDev\XYZ\${build.tomcat.dir}\lib does not exist.**
I am using property file and everything from the property file is taken as expected. Also in the build.xml when I hover my mouse at the **classpathref="tomcat.class.path"**, it is showing all the files from tomcat lib but when I run the task I am getting the above error.
Entry in property file:
build.tomcat.dir=C:/TomcatServer
Any help is appreciated.
Thanks,
It looks like your properties file is loaded inside the ‘clean’ target. If you just invoke the ‘tomcat-stop’ target on its own, the properties file is never loaded. Your other targets are working because they depend on ‘clean’.
Try moving the line that loads your property file so that it is a direct child of the root element. i.e. not nested inside a target.