Prasanna
Prasanna

Reputation: 3771

Play 2.2: Get framework id in GlobalSettings

I am trying to get the framework in GlobalSettings in my play project but I am not sure how to access it in play 2.2. In older versions it was accessed using Play.id and suprisingly there does not seem to be documentation as how to access it.

Can someone point me in the right direction?

Upvotes: 0

Views: 398

Answers (1)

aaberg
aaberg

Reputation: 2273

Play 2.x doesn't use an id to determine whether to start in dev-mode or prod-mode. If you start play 2 with "play run", it starts in dev-mode. If you start play with "play start" or using a script generated with "play stage", it starts in prod-mode.

You can determine whether you are in dev or prod mode with Play.isDev() and Play.isProd() methods.

If you need different configurations for different environments, you have to create different application.conf files for each environment. You can change which configuration file is used at startup, with the -Dconfig.file jvm property.

example:

play -Dconfig.file=conf/prod.conf start

Check this page for more information on this.

Upvotes: 1

Related Questions