How can I define the current directory for the execution of the <jetty>-task?
I use in m开发者_JAVA百科y project the Jetty-task to execute a webapp. Can I somehow set the working-directory used by Jetty as the servlet-container is started?
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>
Does the tempDirectory
attribute not do what you want?
精彩评论