#1461 ✓wontfix
ronin-125131 (at lighthouseapp)

Alternative application.conf file (with system property)

Reported by ronin-125131 (at lighthouseapp) | March 10th, 2012 @ 05:58 PM


I need a feature like in Play 2.0 to externalize application.conf file.
( see https://github.com/playframework/Play20/wiki/Configuration )

So I tried to implement it. ( I will add a comment with the pull request when I have the ticket number)
It doesn't change anything by default (for compatibility purposes).
But you can force the path to the application.conf by setting a system property.

I hope I did a good job and it will be added to Play! 1.2.X


Comments and changes to this ticket

  • ronin-125131 (at lighthouseapp)

    ronin-125131 (at lighthouseapp) March 10th, 2012 @ 06:17 PM

    The pull request is :

    It contains the code and a little upgrade in the documentation to explain it.

    In "samples-and-tests" directory I also add a new application called "external-conf-file" and a file called "external-conf-file.conf"
    You can run the application with "classic mode" : play run => the index page tells you that application file is the internal one.
    Or run with the new feature : play run -Dconfig.file=../external-conf-file.conf => the index page tells you that application file is the external one.

    Feel free to not add this test app if you want.

  • Morten Kjetland

    Morten Kjetland March 11th, 2012 @ 09:23 AM

    I've made some comments on the pullrequest.

    But are this functionality needed? can't you just use the include-functionality and include the file needed?

    I think you can even use groovy code/tag syntax to dynamic resolve what to include.

  • opensource21

    opensource21 March 11th, 2012 @ 11:25 AM

    I think the include-functionality could be a workaround, but the include functionality was never official, because the magic doesn't work for includes. So I would really appreciate to have this feature, it's more natural and more straight forward.
    Main advantage is for me that the person who run's the software can decided where to put the conf-file. In all other cases the developer decide it.

  • ronin-125131 (at lighthouseapp)

    ronin-125131 (at lighthouseapp) March 11th, 2012 @ 06:36 PM

    It will be very useful for me because my company requires to deploy as war file into JBoss, and let conf file outside of the war. (ex:
    production team can change a parameter, like LDAP server, to swith to a backup environment in case of disaster)

    Still with war file deployment, it can be also useful to switch from a "normal" application.file to a "degraded mode" one.

    And, last but not least, Play! 2.0 offer this feature so it surely be useful. :-)

    PS: I hope my explanations are clear, I'm not fluent with english.

  • Morten Kjetland

    Morten Kjetland March 11th, 2012 @ 06:48 PM

    Ok, I follow you on useful feature.

    But as I said, the pullrequest must also take in account that the python files also load application.conf

  • Morten Kjetland

    Morten Kjetland April 5th, 2012 @ 06:03 PM

    • State changed from “new” to “wontfix”
    • Assigned user set to “Morten Kjetland”

    I think this issue is better solved using a module, for example this one:


    I think it is in the process of beeing accepted:

    If it cannot load config from filesystem, please ask him to add that functionality

  • Playgame123

    Playgame123 November 1st, 2017 @ 06:34 AM

    Hello friends it is the most exited to play the amazing tank trouble game most popular in the worldwide so get the hurry and join the best enjoy just click here http://tanktrouble.xyz i hope you like to play this thanks for the visit here very nice shooting game.

  • sykiqisav

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2>Play framework</h2>

Play makes it easier to build Web applications with Java. It is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures. Learn more on the <a href="http://www.playframework.org">http://www.playframework.org</a> website.<br><br>

<h2>Source code is hosted on github</h2>Check out our repository at <a href="http://github.com/playframework/play">http://github.com/playframework/play</a><br><br>

<h2>Contributing, creating a patch</h2> Please read the <a href="http://play.lighthouseapp.com/projects/57987/contributor-guide">contributor guide</a><br><br>

<h2>Reporting Security Vulnerabilities</h2> Since all bug reports are public, please report any security vulnerability directly to <em>guillaume dot bort at gmail dot com</em>.<br><br>

<h2>Creating a bug report</h2> Bug reports are incredibly helpful, so take time to report bugs and request features in our ticket tracker. We’re always grateful for patches to Play’s code. Indeed, bug reports with attached patches will get fixed far quickly than those without any.<br><br>

Please include as much relevant information as possible including the exact framework version you're using and a code snippet that reproduces the problem.<br><br>

Don't have too much expectations. Unless the bug is really a serious "everything is broken" thing, you're creating a ticket to start a discussion. Having a patch (or a branch on Github we can pull from) is better, but then again we'll only pull high quality branches that make sense to be in the core of Play.