For the record:
To activate the dev spring profile in the application in application-dev.war
Create file <CATALINA_BASE>/conf/Catalina/localhost/application-dev.xml
With the following content:
<Context> <Environment name="spring.profiles.active" value="dev,server" type="java.lang.String" override="false" /> </Context>
This is the spring.profiles.active property for dev,server for the application running application-dev.war .
Thanks to this answer: fooobar.com/questions/45709 / ...
PS: With autoDeploy=true in server.xml configuration files disappear when you restart tomcat.
The solution is to add <Context reloadable="true"> to <CATALINA_BASE>/conf/context.xml , but be careful as per the documentation :
This feature is very useful when developing applications, but it requires a significant investment of time and is not recommended for deployed production applications.
and, in addition, using <Context reloadable="true"> does not completely solve the problem when the configuration files still disappear for some restart.
PS2: There is no docBase attribute in the Context element, see this question .
source share