开发者

How can I define the current directory for the execution of the <jetty>-task?

开发者 https://www.devze.com 2022-12-17 00:49 出处:网络
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 a

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消