自定義屬性與載入
配置檔案application.properties
com.compary.name = mbf
@Value("${屬性名}")註解自動載入對應的配置屬性
@Value("${com.compary.name}")
private String name;
複製程式碼
- 打jar包,為打入靜態資源 時在pom中加入
<resource>
<directory>src/main/resources</directory>
<includes>
<include>*</include>
<include>**/*</include>
</includes>
</resource>
複製程式碼
關閉控制檯始終執行jar
nohup java -jar locate-0.0.1-SNAPSHOT.jar &