Use different property files during build build release / debug

I use Gradle as a build tool, and the properties are stored in src / main / resources / myproject.properties. Some examples of properties include:

# Mail server properties
mail.server.url = http://mailserver.example.com
mail.server.username = username
mail.server.password = password

# Server url
app.server.url = http://myserver.mydomain.com

During development, properties have different meanings from production servers. We are currently replacing values ​​before deploying them to the production server. Is there a better way for us to indicate that properties should come from myproject-debug.properties during development, myproject-release.properties during release, myproject-qa during testing?

+4
source share

No one has answered this question yet.

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


All Articles