Answer the question
In order to leave comments, you need to log in
How to make a mutable constant dependent on the dev/prod environment in Java?
I have several variables in my application that need to be changed each time in order to debug locally and then upload the changes, let's say this:
public final class Properties {
public static final String HOST= "localhost"; // dev = localhost | prod = mysite.com
}
Answer the question
In order to leave comments, you need to log in
Add the values to the properties file for each mode. When building the application, set the dev/prod parameter. Depending on the parameter, copy the required file to the assembly. You can get by with one file if you really want to. To do this, for each value, add the prefix dev or prod.
Or something like that)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question