play2-war-plugin Change application path

2019-07-08 03:42发布

In the Play2-war-plugin source code, I saw this piece of code

  val applicationPath = Option(System.getProperty("user.home")).map(new File(_)).getOrElse(new File(""))

On my windows server, this is translated to c:\users\myloginuser

I would like my application to perform file operations under \webapps directory instead of users directory. Is there anyway to achieve this by using Play.application().path()?

1条回答
男人必须洒脱
2楼-- · 2019-07-08 04:27

You can try to change the user.home param while launching your app :

start -Duser.home=c:\users\myloginuser\webapps //not tested
查看更多
登录 后发表回答