混淆运行Spring boot 1.3.0应用程序并指定某些配置文件

时间:2015-11-22 11:20:09

标签: spring-boot

当我使用spring boot 1.3.0 rc1时,按

运行应用程序时
mvn spring-boot:run

在控制台中输出

no profile actived

使用

运行应用程序时
mvn spring-boot:run -Dspring.profiles.active=test

在控制台中,将输出

profile test are activated

但昨天当我改为1.3.0发布并在生产中运行应用程序时,

java -Dspring.profiles.active=production -jar myapp.jar

我无法在控制台中找到以上输出。 另外,我认为如果您指定了生产配置文件,它只会加载appication-production.properties,但它不会加载application.properties。 因此,所有这些让我感到困惑和误导我认为生产配置文件不能影响和运行应用程序java -jar your.jar无法支持-Dspring.profiles.active,同时我的同事等待使用我的服务,所以它给了我很多压力。

任何人都可以解释一下吗?

0 个答案:

没有答案
相关问题