I was looking around here and I still have not found if there is a way, I think you also have it.
When we are developing an application that uses some service, we have somewhere in our code the address of the server that we will use to send / receive the data that usually, when we are developing, point to our Local IP or server and when we go into production let's go in the code and change the address (es) as in the code below:
/* Exemplo */
Class Servidor{
public String final SERVIDOR = "http://192.168.1.8:8080"; //DESENVOLVIMENTO
/* public String final SERVIDOR = "http://servidorproducao.com.br"; //DESENVOLVIMENTO */
}
In Spring I use the spring.profiles.active
that I define as dev where I have the files already configured with all the development addresses that just change an environment variable or in web.xml
itself to change the whole configuration automatically or even in runtime.
Is there anything similar that does this automatically?