Packaging a Play! application straight into a WAR

I am using Play's war command to package up my application into a WAR file for deployment, like so:

play war mydir -o myapp --zip

(Discovering --zip has sure saved me a lot of time!) This command creates a WAR file myapp.war just like it's supposed to, and also an exploded version of the WAR in a directory myapp/ .

I've changed the names of my directories to avoid confusion, but often I want the WAR file to have the same name as my app directory ( mydir , in this example). play war mydir -o mydir --zip fails, of course, rather than overwrite my app directory, which is good.

In a case like this I'd like Play! to skip the directory bit and just get my app straight into a WAR file. Actually, name conflict or not, I'd like to do that anyway; my server is not the same as my dev box, so I just move the WAR file and don't do anything with the exploded version.

So, is there some way to get Play to skip making the exploded version? I've consulted play help war to no avail.


OK, I feel kinda lazy for having asked this. Clearly I can just do it myself:

play war mydir -o myapp --zip
rm -rf myapp
mv myapp.war mydir.war

or for Windows

play war mydir -o myapp --zip
rmdir /S myapp
move myapp.war mydir.war

and drop those commands in a .sh / .bat file. Hope that helps someone in the future.

链接地址: http://www.djcxy.com/p/9552.html

上一篇: 嘲笑Apache会话数据进行单元测试

下一篇: 打包玩! 应用程序直接进入WAR