Environment properties files in a scala project

Just start learning scala for a new project. So much so that I would like to define different property files for different environments in which the application will work, ideally similar to Rails - a very lightweight, only one properties file for each environment, loaded based on its name. I don't care if this is a java, YML or scala property file.

In the spirit of not reinventing the wheel, I was looking to see if there was any standard way for scala to do this, but I couldn’t find it, I found several similar but not identical questions here when people suggest using system properties when running a script, but it seems that it will become a nightmare.

I could obviously realize it, if necessary, but feels like a thing that should already exist. So is that?

I use sbt if that matters.

+4
source share
3 answers

I know Configgy . In addition, Akka / Play 2.0 will use Config , which also looks good. See the blog about the latter.

In principle, Configgy has long been used, but it is deprecated, and Config will be completely new. However, having Config as a Typafe Stack configuration tool is likely to make it the preferred tool for this rather quickly.

+5
source

I wrote a Configgy replacement called Configrity . It can use different input formats (for example, YAML), is immutable, supports functional templates and uses a type class to automatically convert values ​​to the desired type.

+2
source

I wrote BeeConfig, replacing java.util.Properties, except that it is a Scala API and uses UTF-encoded configuration files. It supports line interpolation, chaining and many other functions. But its main goal is simplicity.

Bitbucket | Blog post

Rick

0
source

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


All Articles