Questions tagged «profiles»

7
Spring 3.1中的默认配置文件
在我的应用程序中,我有用@Profile("prod")和注释的bean @Profile("demo")。您可以猜到:)第一个用于连接到生产数据库的bean,第二个注释使用伪造的DB(HashMap或其他)的bean,以加快开发速度。 我想要的是默认配置文件("prod"),如果未被“ something-else ” 覆盖,它将始终使用。 完美将是在我的web.xml: <context-param> <param-name>spring.profiles.active</param-name> <param-value>prod</param-value> </context-param> 然后用覆盖它,-Dspring.profiles.active="demo"这样我就可以做到: mvn jetty:run -Dspring.profiles.active="demo". 但是可悲的是这是行不通的。知道我怎么能做到吗?-Dspring.profiles.active="prod"我无法在所有环境上进行设置。
100 java  spring  profiles 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.