I use in my project the Jetty-task to execute a webapp. Can I somehow set the working-directory used by Jetty as the servlet-container is started?
views:
92answers:
2No, that defines the directory used by jetty to save temporary data, but it is not the current working-directory.
Mnementh
2010-01-19 14:52:11
What is jetty using the current directory for such that you want to change it?
Kevin
2010-01-19 14:58:51
+1
A:
I don't think that you can since the ant task runs jetty in the same VM and there is famously no way to set the current working directory for a running VM. You can try adding a system property for user.dir
but that might not do quite what you want. You could also use the apply
task to relaunch ant with a new working directory with a snippet like
<apply executable="${ant.home}/bin/ant" dir="/new/working/directory/here">
<arg value="-f"/>
<arg value="${ant.file}"/>
<arg value="run-jetty"/>
</apply>
Geoff Reedy
2010-01-19 15:06:07