How can I declare and export modules?

I use secure and crud with my application, and I added them to application.conf as described in the tutorial . However, when I launch the application, it generates a warning:

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

Then the modules work in dev mode, but when deployed to my server (using play war , etc.), I get the following:

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

So, two questions: why are my modules not exported and how do I declare them in dependencies.yml? I looked at the dependencies page in the docs and I admit that I really don't understand what is going on there.

Thanks!

+6
source share
2 answers

The easiest way to configure modules in 1.2+ is to use the --with keyword when creating your application.

for instance

 play new myapp --with crud,secure 

The output of the generated .yml dependencies is

 # Application dependencies require: - play - play -> secure - play -> crud 
+6
source

OK, I decided. I added

 - play -> crud - play -> secure 

on dependencies.yml and removed the corresponding lines in application.conf. Then I ran play dependencies to copy the modules into my application. Playback starts without any warning, and the modules are exported to the WAR file correctly. Hope this helps people!

+5
source

Source: https://habr.com/ru/post/896343/


All Articles