加上這個啟動jar包的時候加上-Dspring.config.location=
-Dspring.config.location=./application.yml
java -Dfile.encoding=utf-8 -jar -Dspring.config.location=./microservice.yaml xxxxx.jar
jar 包啟動時指定配置文件 application.yml
nohup java -jar -Dserver.port=8080 wx-member-card-0.0.1-SNAPSHOT.war --spring.config.location=file:./application-prod.yml,file:./application-dev.yml &
nohup java -jar vTest.jar --spring.config.location=/opt/vTest-conf/application.yml > /opt/vTest-conf/nohup.out 2>&1 &
如果不喜歡將 application.properties 作為配置文件名,你也可以通過指定 spring.config.name 環(huán)境屬性來切換其他的名稱,
也可以使用 spring.config.location 環(huán)境屬性引用一個明確的路徑(目錄位置或文件路徑)
指定配置文件:--spring.config.location=/opt/vpaas-conf/application.yml
將所有的調試信息輸入到:/opt/vpaas-conf/nohup.out