Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I specify a config file with play 2.4 and activator

I am building a Scala Play 2.4 application which uses the typesafe activator.

I would like to run my tests 2 times with a different configuration file for each run.

How can I specify alternative config files, or override the config settings?

I currently run tests with the command "./activator test"

like image 623
James Townley Avatar asked Jul 29 '15 15:07

James Townley


1 Answers

You can create different configuration files for different environments/purposes. For example, I have three configuration files for local testing, alpha deployment, and production deployment as in this project https://github.com/luongbalinh/play-mongo

You can specify the configuration for running as follows:

activator run -Dconfig.resource=application.conf

where application.conf is the configuration you want to use.

like image 54
Luong Ba Linh Avatar answered Sep 22 '22 07:09

Luong Ba Linh