我应该如何声明和导出模块?

and*_*kus 5 java playframework

我正在使用我的应用程序securecrud模块,我已经将它们添加到application.conf中,如教程中所述.但是,当我启动我的应用程序时,它会生成一个警告:

Declaring modules in application.conf is deprecated. Use dependencies.yml instead. (module.crud)

然后这些模块在开发模式下工作,但是当我部署到我的服务器(使用play waretc)时,我得到了这个:

13:55:40,662 WARN ~ Declaring modules in application.conf is deprecated. Use dependencies.yml instead (module.crud)

13:55:40,662 ERROR ~ Module crud will not be loaded because /var/lib/apache-tomcat-6.0.32/webapps/pat/WEB-INF/modules/crud does not exist

所以,有两个问题:为什么我的模块不会被导出,我如何在dependencies.yml中声明它们?我已经查看了文档中的依赖页面,我承认我并没有真正理解那里发生的事情.

谢谢!

Cod*_*nci 6

在play 1.2+中设置模块的最简单方法是在创建应用时使用--with关键字.

例如

play new myapp --with crud,secure 
Run Code Online (Sandbox Code Playgroud)

生成的dependencies.yml的输出是

# Application dependencies

require:
    - play
    - play -> secure
    - play -> crud
Run Code Online (Sandbox Code Playgroud)