java -Dspring.profiles.active -jar xxx.jar
和java -jar xxx.jar --spring.profiles.active
有什么区别
我知道-D是JVM系统参数,但是-是什么?以及定义它的人
--
是特定于Spring Boot的。 Spring Boot应用程序读取此参数。
-Dpring.profiles.active
作为System属性处理,spring可以处理它,应用程序中的任何位置(甚至非Spring驱动)都可以使用System.getProperty
访问它,--spring.profiles.active
由spring内部处理作为命令行参数,两者都可以工作。