1.設定ファイルapplication.properties
##ポート番号
server.port = 8888
プロジェクト##のdevのPROD生産テスト開発環境、テスト環境で使用される##環境設定ファイル
spring.profiles.active =テスト
##プロジェクトのルート・パス
server.servlet.contextパス= / YSD
2.カスタムプロパティの設定
##类自作定义学生属性
student.name =トム
student.age = 22
student.birthday = 1996年/ 01/10
student.sex =真
student.hobbies [0] =スイミング
student.hobbies [1] =バスケットボール
student.skills [0] =プログラミング
student.skills [1] =試験
student.address.province =河南
student.address.city =鄭州
-------------------------------
@Component基づくアノテーション
@ConfigurationProperties同じプレフィックスのクラス名を持つ(プレフィックス=「学生」)プロファイル
@PropertySource({「クラスパス:stu.properties」 }) プロファイルのパス
3.pom.xml
< -项目设置:!编码格式UTF-8 - >
<プロパティ>
<project.build.sourceEncoding> UTF-8 </project.build.sourceEncoding>
<project.reporting.outputEncoding> UTF-8 </プロジェクト。 reporting.outputEncoding>
<のjava.version> 1.8 </java.version>
</プロパティ>
<! -ホットデプロイ- >
<依存>
<groupIdを> org.springframework.boot </ groupIdを>
<たartifactId>ブート春デベロッパーツール</たartifactId>
<オプション> </オプション> <trueに-オプション=! trueの場合、プロジェクトはデベロッパーツールを依存している、渡されません頼る; - >プロジェクト後依存mybootプロジェクトあなたはデベロッパーツールを使用したい場合は、再導入する必要があります
!熱い展開- -真</スコープ> <と> <スコープ>
</依存関係>
<ビルド>
<プラグイン>
<! - SpringBoot插件- >
<プラグイン>
<groupIdを> org.springframework.boot </ groupIdを>
<たartifactId>春・ブートのmaven-pluginの</たartifactId>
</プラグイン>
</プラグイン>
<! - SpringBoot项目打包jarファイル名称- >
<finalName>デモ</ finalName>
</構築>